This commit is contained in:
2025-09-08 17:45:06 -04:00
parent e618b71620
commit 6f47df201d
+8 -3
View File
@@ -785,9 +785,11 @@ async def health() -> HealthResponse:
radarr_db_health = None radarr_db_health = None
overall_status = "healthy" if db_status == "healthy" else "degraded" overall_status = "healthy" if db_status == "healthy" else "degraded"
# Get Radarr client with database access # Get Radarr client with database access from movie processor
radarr_client = client_manager.get_radarr_client() try:
if radarr_client and hasattr(radarr_client, 'db_client') and radarr_client.db_client: 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: try:
radarr_db_health = radarr_client.db_client.health_check() radarr_db_health = radarr_client.db_client.health_check()
if radarr_db_health["status"] != "healthy": if radarr_db_health["status"] != "healthy":
@@ -799,6 +801,9 @@ async def health() -> HealthResponse:
"tested_at": datetime.now(timezone.utc).isoformat(timespec="seconds") "tested_at": datetime.now(timezone.utc).isoformat(timespec="seconds")
} }
overall_status = "degraded" 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( return HealthResponse(
status=overall_status, status=overall_status,