[add]: Database health check #58

Merged
ameye merged 1 commits from health_check into master 2025-10-03 15:28:18 +00:00
+4 -1
View File
@@ -121,9 +121,10 @@ def notification_callback():
def health_check():
response = {"status": "ok"}
response = {}
db_status = "Connect Successful"
error = None
status = "ok"
try:
# Simple query to validate DB connection
@@ -131,7 +132,9 @@ def health_check():
except Exception as e:
db_status = "Connection Failed"
error = str(e)
status = "failed"
response["status"] = status
response["db_status"] = db_status
if error:
response["error"] = error