diff --git a/server.py b/server.py index 1a65851..05eebfa 100644 --- a/server.py +++ b/server.py @@ -77,6 +77,7 @@ async def broadcast_labels_periodically(): # 1) clear stale clients for pid, last_ts in list(CLIENT_LABELS_TS.items()): if now - last_ts > STALE_TIMEOUT: + CLIENT_LABELS[pid] = [] # Optionally also remove their timestamp entry if you don't # want them checked again until next registration/update: @@ -94,6 +95,7 @@ async def broadcast_labels_periodically(): ws.send(payload) for ws in CLIENTS.values() ), return_exceptions=True) logging.debug("Broadcasted labels to %d clients", len(CLIENTS)) + logging.info("Broadcasted labels to %d clients", len(CLIENTS)) await asyncio.sleep(1)