From 6fa655275f5d25d6e12a9975e09cd29ee2126eac Mon Sep 17 00:00:00 2001 From: Urtzi Alfaro Date: Wed, 1 Oct 2025 12:28:00 +0200 Subject: [PATCH] Fix notification service health issues --- services/notification/app/main.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/services/notification/app/main.py b/services/notification/app/main.py index 8fe8d554..4f967a8e 100644 --- a/services/notification/app/main.py +++ b/services/notification/app/main.py @@ -86,20 +86,33 @@ class NotificationService(StandardFastAPIService): # Define custom health checks for notification service components async def check_email_service(): - """Check email service health""" + """Check email service health - service is ready even if credentials are invalid""" try: - return await self.email_service.health_check() if self.email_service else False + if not self.email_service: + return False + # Service is considered healthy if it's initialized, even if credentials fail + # This allows the pod to be ready while external services may have config issues + await self.email_service.health_check() + return True except Exception as e: + # Log but don't fail readiness - email service config issues shouldn't block the pod self.logger.error("Email service health check failed", error=str(e)) - return False + # Return True to indicate service is ready (initialized) even if credentials are wrong + return True async def check_whatsapp_service(): - """Check WhatsApp service health""" + """Check WhatsApp service health - service is ready even if credentials are invalid""" try: - return await self.whatsapp_service.health_check() if self.whatsapp_service else False + if not self.whatsapp_service: + return False + # Service is considered healthy if it's initialized, even if credentials fail + await self.whatsapp_service.health_check() + return True except Exception as e: + # Log but don't fail readiness - WhatsApp config issues shouldn't block the pod self.logger.error("WhatsApp service health check failed", error=str(e)) - return False + # Return True to indicate service is ready (initialized) even if credentials are wrong + return True async def check_sse_service(): """Check SSE service health"""