Skip to content

Commit

Permalink
Fix for websocket connection using 100% of cpu in some case.
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Jan 24, 2019
1 parent 35daaeb commit 7f9f440
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bazarr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7f9f440

Please sign in to comment.