X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fmix%2Fpleroma.ex;h=4dfcc32e78cbf2a4c7c09b618435675949ff01ac;hb=5e365448f3fed98da0395ad69c9325795a85a12d;hp=73a076a531a6ee7fc9963488f6a6ff5804029340;hpb=dedb1ad5d68406bf16ac47d5ad7d2c12f97a10b4;p=akkoma diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index 73a076a53..4dfcc32e7 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -1,10 +1,11 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Pleroma do @doc "Common functions to be reused in mix tasks" def start_pleroma do + Mix.Task.run("app.start") Application.put_env(:phoenix, :serve_endpoints, false, persistent: true) if Pleroma.Config.get(:env) != :test do @@ -12,6 +13,19 @@ defmodule Mix.Pleroma do end {:ok, _} = Application.ensure_all_started(:pleroma) + + 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 end def load_pleroma do