From: Alexander Strizhakov Date: Thu, 21 Jan 2021 06:50:18 +0000 (+0300) Subject: use proper naming X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=6d48144a9d7273e1b6c253164af5550580a6ea9f;p=akkoma use proper naming for MediaProxyWarmingPolicy in ConcurrentLimiter --- 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