Forgot properly invoking the exception
All checks were successful
Build & Publish to GHCR / build (push) Successful in 38s
All checks were successful
Build & Publish to GHCR / build (push) Successful in 38s
This commit is contained in:
parent
51771fb378
commit
8d2020818d
@ -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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user