Fix database health check by properly using SQLAlchemy text()

This commit is contained in:
Automated Action 2025-05-12 14:15:33 +00:00
parent 652f32404a
commit 70cb768862

View File

@ -14,7 +14,8 @@ def health_check(db: Session = Depends(get_db)):
""" """
try: try:
# Check database connection # Check database connection
db.execute(text("SELECT 1")) query = text("SELECT 1")
db.execute(query)
db.commit() db.commit()
db_status = "healthy" db_status = "healthy"
except Exception as e: except Exception as e: