-
-
Notifications
You must be signed in to change notification settings - Fork 572
Closed
Labels
Description
def queue_consumer():
print("Running Queue Consumer")
while True:
with config.connected_set_lock:
connected_websockets = config.connected.copy()
with config.data_queue_lock:
try:
while not config.data_queue.empty():
data = config.data_queue.get()
websockets.broadcast(
connected_websockets, json.dumps(data))
except queue.Empty:
print("queue empty")
except Exception as e:
# Handle the exception
print(f"Exception occurred during broadcast: {e}")
print("Waiting for interval", INTERVAL)
sleep(INTERVAL)
For the above code, it is running fine for few hours, but after that, getting an error "socket.send() raised an exception." continously. And it is not printing the broadcast exception, which we are trying to catch in the above code. Why this might be happening?