commit: 4bb57d4f25bcdc90a63163ba175b6171c9ddbc33
parent c7eda0b24ade372e4e167ae560a2debb555a6e02
Author: Mark Felder <feld@feld.me>
Date: Sat, 20 Jan 2024 18:47:25 -0500
Use config to control background migrators
Diffstat:
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/config/benchmark.exs b/config/benchmark.exs
@@ -79,6 +79,9 @@ IO.puts("RUM enabled: #{rum_enabled}")
config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock
+config :pleroma, Pleroma.Application,
+ background_migrators: false
+
if File.exists?("./config/benchmark.secret.exs") do
import_config "benchmark.secret.exs"
else
diff --git a/config/config.exs b/config/config.exs
@@ -905,6 +905,7 @@ config :pleroma, Pleroma.Search.Meilisearch,
initial_indexing_chunk_size: 100_000
config :pleroma, Pleroma.Application,
+ background_migrators: true,
internal_fetch: true,
load_custom_modules: true,
max_restarts: 3
diff --git a/config/test.exs b/config/test.exs
@@ -163,6 +163,7 @@ peer_module =
config :pleroma, Pleroma.Cluster, peer_module: peer_module
config :pleroma, Pleroma.Application,
+ background_migrators: false,
internal_fetch: false,
load_custom_modules: false,
max_restarts: 100
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex
@@ -108,6 +108,7 @@ defmodule Pleroma.Application do
] ++
task_children() ++
dont_run_in_test(@mix_env) ++
+ background_migrators() ++
shout_child(shout_enabled?()) ++
[Pleroma.Gopher.Server]
@@ -218,14 +219,18 @@ defmodule Pleroma.Application do
keys: :duplicate,
partitions: System.schedulers_online()
]}
- ] ++ background_migrators()
+ ]
end
defp background_migrators do
- [
- Pleroma.Migrators.HashtagsTableMigrator,
- Pleroma.Migrators.ContextObjectsDeletionMigrator
- ]
+ if Application.get_env(:pleroma, __MODULE__)[:background_migrators] do
+ [
+ Pleroma.Migrators.HashtagsTableMigrator,
+ Pleroma.Migrators.ContextObjectsDeletionMigrator
+ ]
+ else
+ []
+ end
end
defp shout_child(true) do