hibatorrahmen commited on
Commit
e40452d
·
1 Parent(s): cbcbcd3
behavior_backend/app/api/routes/health.py CHANGED
@@ -1,5 +1,6 @@
1
  from fastapi import APIRouter, Depends
2
  from sqlalchemy.orm import Session
 
3
  from app.db.base import get_db
4
  import logging
5
 
@@ -26,7 +27,7 @@ async def api_health_check(db: Session = Depends(get_db)):
26
  """
27
  try:
28
  # Try to execute a simple query to check DB connection
29
- db.execute("SELECT 1")
30
  logger.info("Health check: Database connection successful.")
31
  return {
32
  "status": "healthy",
 
1
  from fastapi import APIRouter, Depends
2
  from sqlalchemy.orm import Session
3
+ from sqlalchemy import text
4
  from app.db.base import get_db
5
  import logging
6
 
 
27
  """
28
  try:
29
  # Try to execute a simple query to check DB connection
30
+ db.execute(text("SELECT 1"))
31
  logger.info("Health check: Database connection successful.")
32
  return {
33
  "status": "healthy",