From 7f9f440f1e871d43a35f2fe014fba3dde504ec12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Wed, 23 Jan 2019 22:12:58 -0500 Subject: [PATCH] Fix for websocket connection using 100% of cpu in some case. --- bazarr/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index ed4689199..80bf08a7e 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -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