X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Fnull_cache.ex;h=47c10ebb685b693360141688b8aef3afef39d218;hb=a7ec6e039cdc9ca5a0cc744fbd51511c5ede9f29;hp=72e7c996a78788512d50a43ba93ba38dea7d4e75;hpb=95a9bdfc374a013be47e74b25bdba5d91f51948b;p=akkoma diff --git a/test/support/null_cache.ex b/test/support/null_cache.ex index 72e7c996a..47c10ebb6 100644 --- a/test/support/null_cache.ex +++ b/test/support/null_cache.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.NullCache do @@ -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