diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-02-18 18:10:39 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-03-01 12:36:09 +0300 |
commit | 400fbc7629ff0fbf931cd5cc84d8ce170cd38e1d (patch) | |
tree | 768faf7c194707d0471c1fbd35d3dd8eb90dc930 /lib/mix/pleroma.ex | |
parent | 438394d40447bdfb590ff206ad80907294da0e65 (diff) | |
download | pleroma-400fbc7629ff0fbf931cd5cc84d8ce170cd38e1d.tar.gz pleroma-400fbc7629ff0fbf931cd5cc84d8ce170cd38e1d.zip |
wait in mix task while pleroma is rebooted
Diffstat (limited to 'lib/mix/pleroma.ex')
-rw-r--r-- | lib/mix/pleroma.ex | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index 73a076a53..d2e443fdc 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -12,6 +12,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 |