correct use of healthy / unhealthy

This commit is contained in:
Ishaan Jaff 2024-10-06 13:48:30 +05:30
parent 578f9c91af
commit c133ba25d9
3 changed files with 9 additions and 5 deletions

View file

@ -1496,7 +1496,7 @@ async def key_health(
Response when logging callbacks are not setup correctly:
```json
{
"key": "healthy",
"key": "unhealthy",
"logging_callbacks": {
"callbacks": [
"gcs_bucket"
@ -1525,6 +1525,10 @@ async def key_health(
)
health_status["logging_callbacks"] = logging_statuses
# Check if any logging callback is unhealthy
if logging_statuses.get("status") == "unhealthy":
health_status["key"] = "unhealthy"
return KeyHealthResponse(**health_status)
except Exception as e:
@ -1591,7 +1595,7 @@ async def test_key_logging(
except Exception as e:
return LoggingCallbackStatus(
callbacks=logging_callbacks,
status="error",
status="unhealthy",
details=f"Logging test failed: {str(e)}",
)