diff options
-rw-r--r-- | lib/mix/pleroma.ex | 7 | ||||
-rw-r--r-- | lib/pleroma/application.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/application/dependencies.ex | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index def050d48..0a6752bfb 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -46,12 +46,7 @@ defmodule Mix.Pleroma do Pleroma.Web.Endpoint ] ++ additional_childs - children = - if adapter == Tesla.Adapter.Gun do - [Pleroma.Application.GunSupervisor | children] - else - [Pleroma.Application.HackneySupervisor | children] - end + children = [Pleroma.Application.Dependencies.adapter_module() | children] cachex_children = Enum.map(@cachex_children, &Pleroma.Application.Dependencies.cachex_spec({&1, []})) diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 1736aac23..8652e10a0 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -39,6 +39,7 @@ defmodule Pleroma.Application do # See http://elixir-lang.org/docs/stable/elixir/Application.html # for more information on OTP Applications + @impl true def start(_type, _args) do # Scrubbers are compiled at runtime and therefore will cause a conflict # every time the application is restarted, so we disable module @@ -94,11 +95,13 @@ defmodule Pleroma.Application do Supervisor.start_link(children, strategy: :one_for_one, name: Pleroma.Supervisor) end + @impl true def start_phase(:update_env, :normal, _args) do # Load and update the environment from the config settings in the database Pleroma.Config.Environment.load_and_update() end + @impl true def start_phase(:static_deps, :normal, _args) do # Start static children, # which don't require any configuration or can be configured in runtime @@ -108,6 +111,7 @@ defmodule Pleroma.Application do |> Pleroma.Application.DependenciesSupervisor.start_children(:static) end + @impl true def start_phase(:dynamic_deps, :normal, _args) do # Start dynamic children, # which require restart after some config changes diff --git a/lib/pleroma/application/dependencies.ex b/lib/pleroma/application/dependencies.ex index d796a0473..c0170c7ed 100644 --- a/lib/pleroma/application/dependencies.ex +++ b/lib/pleroma/application/dependencies.ex @@ -104,7 +104,8 @@ defmodule Pleroma.Application.Dependencies do defp add_http_children(children, _), do: [adapter_module() | children] - defp adapter_module do + @spec adapter_module() :: module() + def adapter_module do if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun do GunSupervisor else |