From 02e64ff741e47db77a5c2dc6b8dbc39ec3aec48a Mon Sep 17 00:00:00 2001
From: Eric Frias <efrias@syncad.com>
Date: Sat, 15 Mar 2025 17:44:13 -0400
Subject: [PATCH] Fix healthcheck to return unhealthy when postgresql is
 unreachable

---
 healthchecks/checks/check_haf_lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/healthchecks/checks/check_haf_lib.sh b/healthchecks/checks/check_haf_lib.sh
index d5058db..82f456c 100755
--- a/healthchecks/checks/check_haf_lib.sh
+++ b/healthchecks/checks/check_haf_lib.sh
@@ -1,7 +1,7 @@
 . "$(dirname "$0")/format_seconds.sh"
 
 check_haf_lib() {
-  if [ "$(psql "$POSTGRES_URL" --quiet --no-align --tuples-only --command="SELECT hive.is_instance_ready();")" = f ]; then
+  if [ "$(psql "$POSTGRES_URL" --quiet --no-align --tuples-only --command="SELECT hive.is_instance_ready();")" != t ]; then
     echo "down #HAF not in sync"
     exit 1
   fi
-- 
GitLab