diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-08-12 15:53:06 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-09-24 10:12:05 +0300 |
commit | db51f15ab85e2b1e3dfcc7ed583d703a0465504d (patch) | |
tree | 962d5afd7b5c838e99e2a16339fa111fd642dc47 | |
parent | 4173fef995c90946a7f0b33d696da53507c34664 (diff) | |
download | pleroma-db51f15ab85e2b1e3dfcc7ed583d703a0465504d.tar.gz |
start http children from supervisors in mix tasks
-rw-r--r-- | lib/mix/pleroma.ex | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index 9c7507c21..2c84f939e 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -35,22 +35,20 @@ defmodule Mix.Pleroma do Enum.each(apps, &Application.ensure_all_started/1) - children = - [ - Pleroma.Repo, - Supervisor.child_spec({Task, &Pleroma.Config.Environment.load_and_update/0}, - id: :update_env - ), - Pleroma.Web.Endpoint, - {Oban, Pleroma.Config.get(Oban)} - ] ++ - http_children(adapter) + children = [ + Pleroma.Repo, + Supervisor.child_spec({Task, &Pleroma.Config.Environment.load_and_update/0}, + id: :update_env + ), + Pleroma.Web.Endpoint, + {Oban, Pleroma.Config.get(Oban)} + ] children = if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun do [Pleroma.Application.GunSupervisor | children] else - children + [Pleroma.Applicaiton.HackneySupervisor | children] end cachex_children = @@ -117,11 +115,4 @@ defmodule Mix.Pleroma do def escape_sh_path(path) do ~S(') <> String.replace(path, ~S('), ~S(\')) <> ~S(') end - - defp http_children(Tesla.Adapter.Gun) do - Pleroma.Gun.ConnectionPool.children() ++ - [{Task, &Pleroma.HTTP.AdapterHelper.Gun.limiter_setup/0}] - end - - defp http_children(_), do: [] end |