X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fapplication.ex;h=4742a3ecb72a7f4e102823042702d75b053c0e85;hb=b4ff63d020293bd633bc9c01af1078cacf7f90ed;hp=bd568d8580c75539cc88354823cccbfcdc93b3b9;hpb=67b15cc033fd1154d1e6a96a5c5f141921c2e688;p=akkoma diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index bd568d858..4742a3ecb 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Application do @@ -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