better error handling channel send

This commit is contained in:
Timothy Pogue 2022-11-02 15:25:39 -06:00
parent 55bf195bfb
commit 2dc55e89e6
1 changed files with 5 additions and 4 deletions

View File

@ -78,11 +78,12 @@ class WebSocketChannel:
self.queue.put(data),
timeout=self.drain_timeout
)
return True
except Exception:
# We must catch any exception here to prevent an exception bubbling
# up and stalling the broadcast thread
except asyncio.TimeoutError:
return False
except RuntimeError:
pass
return True
async def recv(self):
"""