More graceful health check handling of this connection not being ready

This commit is contained in:
doctorpangloss 2025-02-06 11:08:09 -08:00
parent 4c72ef5bac
commit ef74b9fdda

View File

@ -42,7 +42,7 @@ class DistributedPromptWorker:
self._health_check_site: Optional[web.TCPSite] = None
async def _health_check(self, request):
if self._connection is None:
if not hasattr(self, "_connection") or self._connection is None:
return web.Response(text="UNHEALTHY: RabbitMQ connection is not established", status=503)
is_healthy = await self._is_connection_healthy()