use proper naming

for MediaProxyWarmingPolicy in ConcurrentLimiter
This commit is contained in:
Alexander Strizhakov 2021-01-21 09:50:18 +03:00
parent dece31a031
commit 6d48144a9d
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
4 changed files with 4 additions and 4 deletions

View file

@ -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],

View file

@ -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:

View file

@ -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, [])

View file

@ -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