🐛 Fix health check http endpoint

This commit is contained in:
Andrey Antukh 2023-01-23 09:59:55 +01:00
parent fa17ce5d40
commit 504f75a1cf

View file

@ -349,15 +349,14 @@
(defn health-handler (defn health-handler
"Mainly a task that performs a health check." "Mainly a task that performs a health check."
[{:keys [pool]} _] [{:keys [::db/pool]} _]
(db/with-atomic [conn pool] (try
(try (db/exec-one! pool ["select count(*) as count from server_prop;"])
(db/exec-one! conn ["select count(*) as count from server_prop;"]) (yrs/response 200 "OK")
(yrs/response 200 "OK") (catch Throwable cause
(catch Throwable cause (l/warn :hint "unable to execute query on health handler"
(l/warn :hint "unable to execute query on health handler" :cause cause)
:cause cause) (yrs/response 503 "KO"))))
(yrs/response 503 "KO")))))
(defn changelog-handler (defn changelog-handler
[_ _] [_ _]