Use finch everywhere (#33)
[akkoma] / lib / pleroma / web / activity_pub / mrf / media_proxy_warming_policy.ex
index 816cc89bfe2f9799ff62303bb64ce83801648365..f60a76adfa18eca7a9cc4a4a3ddb4a0cd88f6868 100644 (file)
@@ -1,10 +1,10 @@
 # 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.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
   @moduledoc "Preloads any attachments in the MediaProxy cache by prefetching them"
-  @behaviour Pleroma.Web.ActivityPub.MRF
+  @behaviour Pleroma.Web.ActivityPub.MRF.Policy
 
   alias Pleroma.HTTP
   alias Pleroma.Web.MediaProxy
@@ -12,7 +12,6 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
   require Logger
 
   @adapter_options [
-    pool: :media,
     recv_timeout: 10_000
   ]
 
@@ -27,7 +26,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
       if Pleroma.Config.get(:env) == :test do
         fetch(prefetch_url)
       else
-        ConcurrentLimiter.limit(MediaProxy, fn ->
+        ConcurrentLimiter.limit(__MODULE__, fn ->
           Task.start(fn -> fetch(prefetch_url) end)
         end)
       end