From fb3fd692c66ca0f09c25067c2d024157144e1118 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 7 Dec 2020 16:36:44 -0600 Subject: [PATCH] Add a startup error for modified Repo pool_size --- lib/pleroma/application_requirements.ex | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/pleroma/application_requirements.ex b/lib/pleroma/application_requirements.ex index b977257a3..41f6c6e34 100644 --- a/lib/pleroma/application_requirements.ex +++ b/lib/pleroma/application_requirements.ex @@ -24,6 +24,7 @@ def verify! do |> check_migrations_applied!() |> check_welcome_message_config!() |> check_rum!() + |> check_repo_pool_size!() |> handle_result() end @@ -188,6 +189,24 @@ defp check_system_commands!(:ok) do defp check_system_commands!(result), do: result + defp check_repo_pool_size!(:ok) do + if Pleroma.Config.get([Pleroma.Repo, :pool_size], 10) != 10 and + not Pleroma.Config.get([:dangerzone, :override_repo_pool_size], false) do + Logger.error(""" + !!!CONFIG WARNING!!! + The database pool size has been altered from the recommended value of 10.\n + Please revert or ensure your database is tuned appropriately and then set\n + `config :pleroma, :dangerzone, override_repo_pool_size: true`. + """) + + {:error, "Repo.pool_size above recommended value."} + else + :ok + end + end + + defp check_repo_pool_size!(result), do: result + defp check_filter(filter, command_required) do filters = Config.get([Pleroma.Upload, :filters])