use proper naming
for MediaProxyWarmingPolicy in ConcurrentLimiter
This commit is contained in:
parent
dece31a031
commit
6d48144a9d
@ -3358,7 +3358,7 @@ config :pleroma, :config_description, [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
key: Pleroma.Web.MediaProxy,
|
key: Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy,
|
||||||
type: :keyword,
|
type: :keyword,
|
||||||
description: "Concurrent limits configuration for MediaProxyWarmingPolicy.",
|
description: "Concurrent limits configuration for MediaProxyWarmingPolicy.",
|
||||||
suggestions: [max_running: 5, max_waiting: 5],
|
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:
|
Settings to restrict concurrently running jobs. Jobs which can be configured:
|
||||||
|
|
||||||
* `Pleroma.Web.RichMedia.Helpers` - generating link previews of URLs in activities
|
* `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:
|
Each job has these settings:
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ defmodule Pleroma.Application do
|
|||||||
def limiters_setup do
|
def limiters_setup do
|
||||||
config = Config.get(ConcurrentLimiter, [])
|
config = Config.get(ConcurrentLimiter, [])
|
||||||
|
|
||||||
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
|
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy]
|
||||||
|> Enum.each(fn module ->
|
|> Enum.each(fn module ->
|
||||||
mod_config = Keyword.get(config, module, [])
|
mod_config = Keyword.get(config, module, [])
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
|
|||||||
if Pleroma.Config.get(:env) == :test do
|
if Pleroma.Config.get(:env) == :test do
|
||||||
fetch(prefetch_url)
|
fetch(prefetch_url)
|
||||||
else
|
else
|
||||||
ConcurrentLimiter.limit(MediaProxy, fn ->
|
ConcurrentLimiter.limit(__MODULE__, fn ->
|
||||||
Task.start(fn -> fetch(prefetch_url) end)
|
Task.start(fn -> fetch(prefetch_url) end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user