start limiters in mix tasks
This commit is contained in:
parent
79a509ee61
commit
0a5b22bc3b
@ -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
|
||||||
|
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user