INNER CODE UNIT · Python
_heartbeat_only
Soju06/codex-lb · app/main.py:774
async def _heartbeat_only(svc: RingMembershipService, iid: str) -> None:
while True:
await asyncio.sleep(RING_HEARTBEAT_INTERVAL_SECONDS)
try:
await svc.heartbeat(iid, endpoint_base_url=bridge_endpoint_base_url)
except Exception:
logger.warning("Ring heartbeat failed", exc_info=True)
await run_http_bridge_heartbeat_maintenance(getattr(app.state, "proxy_service", None))
await refresh_cap_partition(svc.list_active, iid)
async def _register_and_heartbeat(svc: RingMembershipService, iid: str) -> None:
attempt = 0
while True:
attempt += 1
try:
await _complete_bridge_registration(svc, iid)
logger.info("Registered in bridge ring", extra={"instance_id": iid, "attempt": attempt})
break