Fix for websocket connection using 100% of cpu in some case.

This commit is contained in:
Louis Vézina 2019-01-23 22:12:58 -05:00
parent 35daaeb6f2
commit 7f9f440f1e
1 changed files with 4 additions and 2 deletions

View File

@ -1754,9 +1754,11 @@ def handle_websocket():
while True:
try:
if len(queueconfig.q4ws) > 0:
if queueconfig.q4ws:
wsock.send(queueconfig.q4ws.popleft())
gevent.sleep(0)
gevent.sleep(0.1)
else:
gevent.sleep(0.5)
except WebSocketError:
break