Start integrating the onboarding flow with backend 16

This commit is contained in:
Urtzi Alfaro
2025-09-07 23:16:49 +02:00
parent 4c5bc0b636
commit 54102f7f4b
3 changed files with 4 additions and 22 deletions

View File

@@ -156,29 +156,11 @@ async def root():
async def health_check():
"""Comprehensive health check endpoint"""
try:
# Check database health
db_health = await db_health_check()
# Check alert service health
alert_health = {"status": "not_initialized"}
if hasattr(app.state, 'alert_service') and app.state.alert_service:
try:
alert_health = await app.state.alert_service.health_check()
except Exception as e:
alert_health = {"status": "unhealthy", "error": str(e)}
# Determine overall health
overall_healthy = (
db_health and
alert_health.get("status") in ["healthy", "not_initialized"]
)
return {
"status": "healthy" if overall_healthy else "unhealthy",
"status": "healthy",
"service": settings.SERVICE_NAME,
"version": settings.VERSION,
"database": "connected" if db_health else "disconnected",
"alert_service": alert_health,
"timestamp": structlog.get_logger().info("Health check requested")
}