Caching: Add caching behavior, add null implementation.
This commit is contained in:
parent
95a9bdfc37
commit
ee81a94ab2
2 changed files with 24 additions and 3 deletions
|
|
@ -21,9 +21,11 @@ defmodule Pleroma.NullCache do
|
|||
def get(_, _), do: {:ok, nil}
|
||||
|
||||
@impl true
|
||||
def fetch!(_, _, func) do
|
||||
{_, res} = func.()
|
||||
res
|
||||
def fetch!(_, key, func) do
|
||||
case func.(key) do
|
||||
{_, res} -> res
|
||||
res -> res
|
||||
end
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue