db error
This commit is contained in:
+8
-3
@@ -785,9 +785,11 @@ async def health() -> HealthResponse:
|
||||
radarr_db_health = None
|
||||
overall_status = "healthy" if db_status == "healthy" else "degraded"
|
||||
|
||||
# Get Radarr client with database access
|
||||
radarr_client = client_manager.get_radarr_client()
|
||||
if radarr_client and hasattr(radarr_client, 'db_client') and radarr_client.db_client:
|
||||
# Get Radarr client with database access from movie processor
|
||||
try:
|
||||
if hasattr(movie_processor, 'radarr') and movie_processor.radarr:
|
||||
radarr_client = movie_processor.radarr
|
||||
if hasattr(radarr_client, 'db_client') and radarr_client.db_client:
|
||||
try:
|
||||
radarr_db_health = radarr_client.db_client.health_check()
|
||||
if radarr_db_health["status"] != "healthy":
|
||||
@@ -799,6 +801,9 @@ async def health() -> HealthResponse:
|
||||
"tested_at": datetime.now(timezone.utc).isoformat(timespec="seconds")
|
||||
}
|
||||
overall_status = "degraded"
|
||||
except Exception as e:
|
||||
# If movie processor isn't available, skip database health check
|
||||
_log("DEBUG", f"Skipping Radarr database health check: {e}")
|
||||
|
||||
return HealthResponse(
|
||||
status=overall_status,
|
||||
|
||||
Reference in New Issue
Block a user