Updates server logic
All checks were successful
Build and Push Multi-Platform Docker Image / build-and-push (push) Successful in 15s

This commit is contained in:
Hirviturkki
2025-04-21 21:14:50 +02:00
parent 720fb915fe
commit 4ac82d6134

View File

@@ -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)