configurable limits for ConcurrentLimiter
Pleroma.Web.RichMedia.Helpers & Pleroma.Web.MediaProxy
This commit is contained in:
parent
b5899fda1a
commit
b4ff63d020
4 changed files with 75 additions and 1 deletions
|
|
@ -297,7 +297,16 @@ defmodule Pleroma.Application do
|
|||
|
||||
@spec limiters_setup() :: :ok
|
||||
def limiters_setup do
|
||||
config = Config.get(ConcurrentLimiter, [])
|
||||
|
||||
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
|
||||
|> Enum.each(&ConcurrentLimiter.new(&1, 1, 0))
|
||||
|> Enum.each(fn module ->
|
||||
mod_config = Keyword.get(config, module, [])
|
||||
|
||||
max_running = Keyword.get(mod_config, :max_running, 5)
|
||||
max_waiting = Keyword.get(mod_config, :max_waiting, 5)
|
||||
|
||||
ConcurrentLimiter.new(module, max_running, max_waiting)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue