Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

50 строки
896B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.NullCache do
  5. @moduledoc """
  6. A module simulating a permanently empty cache.
  7. """
  8. @behaviour Pleroma.Caching
  9. @impl true
  10. def get!(_, _), do: nil
  11. @impl true
  12. def put(_, _, _, _ \\ nil), do: {:ok, true}
  13. @impl true
  14. def stream!(_, _), do: []
  15. @impl true
  16. def get(_, _), do: {:ok, nil}
  17. @impl true
  18. def fetch!(_, key, func) do
  19. case func.(key) do
  20. {_, res} -> res
  21. res -> res
  22. end
  23. end
  24. @impl true
  25. def get_and_update(_, _, func) do
  26. func.(nil)
  27. end
  28. @impl true
  29. def expire_at(_, _, _), do: {:ok, true}
  30. @impl true
  31. def exists?(_, _), do: {:ok, false}
  32. @impl true
  33. def execute!(_, func) do
  34. func.(:nothing)
  35. end
  36. @impl true
  37. def del(_, _), do: {:ok, true}
  38. end