From cf441c866c82e0fa865cc6062eb8051fabbf3fe9 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 13 Dec 2025 22:26:45 +0100 Subject: [PATCH] man --- modules/web.html | 2 +- modules/web.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/web.html b/modules/web.html index 5801987..51af747 100644 --- a/modules/web.html +++ b/modules/web.html @@ -166,7 +166,7 @@ renderPlaylist(); } else if(msg.event === "new_track"){ applyTrackState(msg.data); - ws.send(JSON.stringify({action:"get_toplay"})) + ws.send(JSON.stringify({action:"get_toplay"})); } else if(msg.event === "progress"){ applyProgressState(msg.data); } else if(msg.event === "toplay") { diff --git a/modules/web.py b/modules/web.py index 59641d2..4144c40 100644 --- a/modules/web.py +++ b/modules/web.py @@ -84,15 +84,14 @@ async def broadcast_worker(ws_q: multiprocessing.Queue, clients: set): """ loop = asyncio.get_event_loop() while True: - try: msg = await asyncio.wait_for(loop.run_in_executor(None, ws_q.get), 1.0) - except asyncio.TimeoutError: continue + msg = await loop.run_in_executor(None, ws_q.get) if msg is None: break payload = json.dumps(msg) if clients: - await asyncio.gather( - *[_safe_send(ws, payload, clients) for ws in list(clients)], - return_exceptions=True - ) + coros = [] + for ws in list(clients): + coros.append(_safe_send(ws, payload, clients)) + await asyncio.gather(*coros) async def _safe_send(ws, payload: str, clients: set):