wait in mix task while pleroma is rebooted
[akkoma] / lib / mix / pleroma.ex
index 73a076a531a6ee7fc9963488f6a6ff5804029340..d2e443fdc624d5a4b422f974a20d4e30737a46d5 100644 (file)
@@ -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