Add option to modify HTTP pool size
[akkoma] / test / support / null_cache.ex
index 72e7c996a78788512d50a43ba93ba38dea7d4e75..47c10ebb685b693360141688b8aef3afef39d218 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # 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