Forgot properly invoking the exception
All checks were successful
Build & Publish to GHCR / build (push) Successful in 38s

This commit is contained in:
florian 2025-10-10 12:00:48 +02:00
parent 51771fb378
commit 8d2020818d

View File

@ -67,13 +67,13 @@ async def prometheus_middleware(request: Request, call_next):
return response
@api.get("/health", tags=["Health"])
async def return_health(db=Depends(get_db)):
def return_health(db=Depends(get_db)):
try:
cursor = db.cursor()
cursor.execute("SELECT 1")
cursor.fetchone()
db_status = "ok"
except Exception:
except Exception as e:
logger.error(f"Health check DB failed: {e}")
db_status = "error"