use proper naming
for MediaProxyWarmingPolicy in ConcurrentLimiter
This commit is contained in:
parent
dece31a031
commit
6d48144a9d
|
@ -3358,7 +3358,7 @@
|
|||
]
|
||||
},
|
||||
%{
|
||||
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],
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ defp http_children(_, _), 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, [])
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ defp prefetch(url) 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
|
||||
|
|
Loading…
Reference in New Issue