From 504f75a1cfea5b9edf6999a1d93f29a9204e32e7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 23 Jan 2023 09:59:55 +0100 Subject: [PATCH] :bug: Fix health check http endpoint --- backend/src/app/http/debug.clj | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index 1d342b9fbd..580fefb0f1 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -349,15 +349,14 @@ (defn health-handler "Mainly a task that performs a health check." - [{:keys [pool]} _] - (db/with-atomic [conn pool] - (try - (db/exec-one! conn ["select count(*) as count from server_prop;"]) - (yrs/response 200 "OK") - (catch Throwable cause - (l/warn :hint "unable to execute query on health handler" - :cause cause) - (yrs/response 503 "KO"))))) + [{:keys [::db/pool]} _] + (try + (db/exec-one! pool ["select count(*) as count from server_prop;"]) + (yrs/response 200 "OK") + (catch Throwable cause + (l/warn :hint "unable to execute query on health handler" + :cause cause) + (yrs/response 503 "KO")))) (defn changelog-handler [_ _]