From b28cc154596ad9cbf5ef9708a5967672c61ddbdc Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Fri, 3 Jul 2020 20:12:00 +0300 Subject: [PATCH] don't restart pleroma in mix tasks --- lib/mix/pleroma.ex | 6 +++++- lib/pleroma/config/transfer_task.ex | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index 553c74c25..0fbb6f1cd 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -22,7 +22,11 @@ def start_pleroma do Enum.each(apps, &Application.ensure_all_started/1) - childs = [Pleroma.Repo, Pleroma.Config.TransferTask, Pleroma.Web.Endpoint] + childs = [ + Pleroma.Repo, + {Pleroma.Config.TransferTask, false}, + Pleroma.Web.Endpoint + ] cachex_childs = Enum.map(@cachex_childs, &Pleroma.Application.build_cachex(&1, [])) diff --git a/lib/pleroma/config/transfer_task.ex b/lib/pleroma/config/transfer_task.ex index eb86b8ff4..a0d7b7d71 100644 --- a/lib/pleroma/config/transfer_task.ex +++ b/lib/pleroma/config/transfer_task.ex @@ -31,8 +31,8 @@ defmodule Pleroma.Config.TransferTask do {:pleroma, :gopher, [:enabled]} ] - def start_link(_) do - load_and_update_env() + def start_link(restart_pleroma? \\ true) do + load_and_update_env([], restart_pleroma?) if Config.get(:env) == :test, do: Ecto.Adapters.SQL.Sandbox.checkin(Repo) :ignore end