Merge branch 'fix/mix-tasks' into 'develop'

Start limiters in mix tasks

Closes #2320

See merge request pleroma/pleroma!3165
This commit is contained in:
lain 2020-11-20 10:30:02 +00:00
commit d8924e1a56
2 changed files with 2 additions and 0 deletions

View file

@ -19,6 +19,7 @@ defmodule Mix.Pleroma do
def start_pleroma do def start_pleroma do
Pleroma.Config.Holder.save_default() Pleroma.Config.Holder.save_default()
Pleroma.Config.Oban.warn() Pleroma.Config.Oban.warn()
Pleroma.Application.limiters_setup()
Application.put_env(:phoenix, :serve_endpoints, false, persistent: true) Application.put_env(:phoenix, :serve_endpoints, false, persistent: true)
if Pleroma.Config.get(:env) != :test do if Pleroma.Config.get(:env) != :test do

View file

@ -274,6 +274,7 @@ defmodule Pleroma.Application do
defp http_children(_, _), do: [] defp http_children(_, _), do: []
@spec limiters_setup() :: :ok
def limiters_setup do def limiters_setup do
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy] [Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
|> Enum.each(&ConcurrentLimiter.new(&1, 1, 0)) |> Enum.each(&ConcurrentLimiter.new(&1, 1, 0))