diff --git a/cognee/api/client.py b/cognee/api/client.py index 148f2d883..60f3134c7 100644 --- a/cognee/api/client.py +++ b/cognee/api/client.py @@ -226,7 +226,11 @@ async def cloud_health_check(): return JSONResponse(status_code=status_code, content=health_status.model_dump()) except Exception as e: - return JSONResponse(status_code=503, content={"status": "unhealthy", "error": f"Cloud health check failed: {str(e)}"}) + return JSONResponse( + status_code=503, + content={"status": "unhealthy", "error": f"Cloud health check failed: {str(e)}"}, + ) + app.include_router(get_auth_router(), prefix="/api/v1/auth", tags=["auth"]) diff --git a/cognee/api/health.py b/cognee/api/health.py index dc56c6e7a..6de0a4d81 100644 --- a/cognee/api/health.py +++ b/cognee/api/health.py @@ -329,8 +329,10 @@ class HealthChecker: start_time = time.time() try: from cognee.modules.cloud.operations import check_api_key + # TODO: consider moving this to a more appropriate place from cognee.api.v1.sync.sync import _get_cloud_auth_token + await check_api_key(_get_cloud_auth_token()) response_time = int((time.time() - start_time) * 1000) return ComponentHealth( @@ -349,5 +351,6 @@ class HealthChecker: details=f"Connection failed: {str(e)}", ) + # Global health checker instance health_checker = HealthChecker()