Expose DB connection error in /health response for debugging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 21:10:38 +02:00
parent 16a13293cf
commit 03eebc4f9b
2 changed files with 11 additions and 9 deletions

View File

@@ -13,10 +13,10 @@ def _params() -> dict:
}
def check_db() -> bool:
def check_db() -> tuple[bool, str]:
try:
conn = pymysql.connect(**_params())
conn.close()
return True
except Exception:
return False
return True, "ok"
except Exception as e:
return False, str(e)