summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-06-07 12:37:20 +0300
committerrinpatch <rinpatch@sdf.org>2019-06-07 12:37:20 +0300
commitbc597d888c95ed7d91534cc8083152f3282393e3 (patch)
tree6b4c854f4da56c4aa15fbb0b5cf6438054b463f8
parent62cdf701f47352004c293c3ca049d232b3d16af7 (diff)
downloadpleroma-bc597d888c95ed7d91534cc8083152f3282393e3.tar.gz
pleroma-bc597d888c95ed7d91534cc8083152f3282393e3.zip
Mix Tasks: Switch to Application.ensure_all_started instead of
Mix.Task.run and ensure serve_endpoints is set to false In release environments there is no Mix.Task.run and serve_endpoints must be set to true for the endpoints to start, so we need to ensure it is set to false before starting Pleroma for executing a mix task.
-rw-r--r--lib/mix/tasks/pleroma/common.ex3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mix/tasks/pleroma/common.ex b/lib/mix/tasks/pleroma/common.ex
index 48c0c1346..25977f656 100644
--- a/lib/mix/tasks/pleroma/common.ex
+++ b/lib/mix/tasks/pleroma/common.ex
@@ -5,7 +5,8 @@
defmodule Mix.Tasks.Pleroma.Common 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)
+ {:ok, _} = Application.ensure_all_started(:pleroma)
end
def get_option(options, opt, prompt, defval \\ nil, defname \\ nil) do