- Application.put_env(:logger, :console, level: :debug)
- {:ok, _} = Application.ensure_all_started(:pleroma)
+
+ if Pleroma.Config.get(:env) != :test do
+ Application.put_env(:logger, :console, level: :debug)
+ end
+
+ apps =
+ if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun do
+ [:gun | @apps]
+ else
+ [:hackney | @apps]
+ end
+
+ Enum.each(apps, &Application.ensure_all_started/1)
+
+ children = [
+ Pleroma.Repo,
+ {Pleroma.Config.TransferTask, false},
+ Pleroma.Web.Endpoint
+ ]
+
+ cachex_children = Enum.map(@cachex_children, &Pleroma.Application.build_cachex(&1, []))
+
+ Supervisor.start_link(children ++ cachex_children,
+ strategy: :one_for_one,
+ name: Pleroma.Supervisor
+ )
+
+ if Pleroma.Config.get(:env) not in [:test, :benchmark] do
+ pleroma_rebooted?()
+ end
+ end
+
+ defp pleroma_rebooted? do
+ if Restarter.Pleroma.rebooted?() do
+ :ok
+ else
+ Process.sleep(10)
+ pleroma_rebooted?()
+ end