From 6d48144a9d7273e1b6c253164af5550580a6ea9f Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Thu, 21 Jan 2021 09:50:18 +0300 Subject: [PATCH] use proper naming for MediaProxyWarmingPolicy in ConcurrentLimiter --- config/description.exs | 2 +- docs/configuration/cheatsheet.md | 2 +- lib/pleroma/application.ex | 2 +- lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/description.exs b/config/description.exs index 49fea4234..715a0d0c3 100644 --- a/config/description.exs +++ b/config/description.exs @@ -3358,7 +3358,7 @@ config :pleroma, :config_description, [ ] }, %{ - key: Pleroma.Web.MediaProxy, + key: Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, type: :keyword, description: "Concurrent limits configuration for MediaProxyWarmingPolicy.", suggestions: [max_running: 5, max_waiting: 5], diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index e7a1b40b1..5c0fd6487 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -1116,7 +1116,7 @@ Settings to enable and configure expiration for ephemeral activities Settings to restrict concurrently running jobs. Jobs which can be configured: * `Pleroma.Web.RichMedia.Helpers` - generating link previews of URLs in activities -* `Pleroma.Web.MediaProxy` - fetching remote media via MediaProxy +* `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy` - warming remote media cache via MediaProxyWarmingPolicy Each job has these settings: diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 4742a3ecb..9e262235e 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -299,7 +299,7 @@ defmodule Pleroma.Application do def limiters_setup do config = Config.get(ConcurrentLimiter, []) - [Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy] + [Pleroma.Web.RichMedia.Helpers, Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy] |> Enum.each(fn module -> mod_config = Keyword.get(config, module, []) diff --git a/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex b/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex index 50d48edc8..8dbf44071 100644 --- a/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/media_proxy_warming_policy.ex @@ -27,7 +27,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