summaryrefslogtreecommitdiff
path: root/test/support/null_cache.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-12-21 11:42:53 +0100
committerlain <lain@soykaf.club>2020-12-21 11:42:53 +0100
commitee81a94ab2631e994f7d963d74fadf1ce0704837 (patch)
tree96aa1922696c8084570031701708e47ab9c7d611 /test/support/null_cache.ex
parent95a9bdfc374a013be47e74b25bdba5d91f51948b (diff)
downloadpleroma-ee81a94ab2631e994f7d963d74fadf1ce0704837.tar.gz
pleroma-ee81a94ab2631e994f7d963d74fadf1ce0704837.zip
Caching: Add caching behavior, add null implementation.
Diffstat (limited to 'test/support/null_cache.ex')
-rw-r--r--test/support/null_cache.ex8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/support/null_cache.ex b/test/support/null_cache.ex
index 72e7c996a..c63df6a39 100644
--- a/test/support/null_cache.ex
+++ b/test/support/null_cache.ex
@@ -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