diff --git a/src/main.py b/src/main.py index 04aeba4..fb69bcb 100644 --- a/src/main.py +++ b/src/main.py @@ -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"