fix: thread not dead

This commit is contained in:
Vlad Stan 2023-07-05 09:09:10 +03:00
parent 3b08714a84
commit 403c8f1b05
2 changed files with 11 additions and 8 deletions

View file

@ -102,12 +102,14 @@ class Relay:
message = self.queue.get(timeout=1)
self.num_sent_events += 1
self.ws.send(message)
except Exception as e:
if self.shutdown:
logger.warning(f"Closing queue worker for '{self.url}'.")
break
except:
pass
else:
time.sleep(0.1)
if self.shutdown:
logger.warning(f"Closing queue worker for '{self.url}'.")
break
def add_subscription(self, id, filters: Filters):
with self.lock: