fix health check issue
Browse files- backend/api/routes.py +2 -1
backend/api/routes.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from fastapi import APIRouter, Depends, HTTPException
|
|
|
|
| 2 |
from sqlalchemy.orm import Session
|
| 3 |
|
| 4 |
from database.database import get_db
|
|
@@ -17,7 +18,7 @@ def health_check(db: Session = Depends(get_db)):
|
|
| 17 |
try:
|
| 18 |
# Test database connection using SQLAlchemy
|
| 19 |
# Execute a simple query to test the connection
|
| 20 |
-
db.execute("SELECT 1")
|
| 21 |
|
| 22 |
return {
|
| 23 |
"status": "healthy",
|
|
|
|
| 1 |
from fastapi import APIRouter, Depends, HTTPException
|
| 2 |
+
from sqlalchemy import text
|
| 3 |
from sqlalchemy.orm import Session
|
| 4 |
|
| 5 |
from database.database import get_db
|
|
|
|
| 18 |
try:
|
| 19 |
# Test database connection using SQLAlchemy
|
| 20 |
# Execute a simple query to test the connection
|
| 21 |
+
db.execute(text("SELECT 1"))
|
| 22 |
|
| 23 |
return {
|
| 24 |
"status": "healthy",
|