summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2023-11-14 09:41:26 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2023-11-14 09:41:26 +0000
commitbf2d6abaf2f7ccc908c512a8d5be4e091779e9e5 (patch)
treee1c73ddc38a4e22c9443ec6b398db3fecb8d14ff /lib
parent752bc168f6877e6a3ce2e2e508ec50069e9c1f61 (diff)
parent2f6fc6a7ab0e757abfe9ec535842a12b887d2fe6 (diff)
downloadpleroma-bf2d6abaf2f7ccc908c512a8d5be4e091779e9e5.tar.gz
pleroma-bf2d6abaf2f7ccc908c512a8d5be4e091779e9e5.zip
Merge branch 'healthcheck-disabled-error' into 'develop'
TwitterAPI: Return proper error when healthcheck is disabled See merge request pleroma/pleroma!3953
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/controllers/util_controller.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
index d5a24ae6c..ca8a98960 100644
--- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex
+++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
@@ -345,13 +345,16 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
end
def healthcheck(conn, _params) do
- with true <- Config.get([:instance, :healthcheck]),
+ with {:cfg, true} <- {:cfg, Config.get([:instance, :healthcheck])},
%{healthy: true} = info <- Healthcheck.system_info() do
json(conn, info)
else
%{healthy: false} = info ->
service_unavailable(conn, info)
+ {:cfg, false} ->
+ service_unavailable(conn, %{"error" => "Healthcheck disabled"})
+
_ ->
service_unavailable(conn, %{})
end