Remove comments and verbose logging from services

This commit is contained in:
rafaeldpsilva
2025-09-23 15:05:59 +01:00
parent 78151feb86
commit ba99b09e08
7 changed files with 11 additions and 43 deletions

View File

@@ -39,7 +39,6 @@ class ServiceRegistry:
logger.info(f"Registered {len(services)} services")
# Perform initial health check
await self.update_all_service_health()
async def register_service(self, service_config: ServiceConfig):
@@ -83,7 +82,6 @@ class ServiceRegistry:
if response.status == 200:
health_data = await response.json()
status = "healthy" if health_data.get("status") in ["healthy", "ok"] else "unhealthy"
health = ServiceHealth(
service=service_name,
status=status,
@@ -114,10 +112,8 @@ class ServiceRegistry:
error_message=f"Health check failed: {str(e)}"
)
# Update health status
self.service_health[service_name] = health
# Log health status changes
if health.status != "healthy":
logger.warning(f"Service {service_name} health check failed: {health.error_message}")
@@ -128,13 +124,12 @@ class ServiceRegistry:
self.check_service_health(service_name)
for service_name in self.services.keys()
]
if health_checks:
await asyncio.gather(*health_checks, return_exceptions=True)
healthy_count = sum(1 for h in self.service_health.values() if h.status == "healthy")
total_count = len(self.services)
logger.info(f"Health check complete: {healthy_count}/{total_count} services healthy {self.service_health.values()}")
logger.info(f"Health check complete: {healthy_count}/{total_count} services healthy")
async def get_service_health(self, service_name: str) -> Optional[ServiceHealth]:
return self.service_health.get(service_name)