Fix not-stopping on loop
This commit is contained in:
parent
185962ace5
commit
b911caa5af
1 changed files with 6 additions and 3 deletions
|
@ -156,6 +156,9 @@ class WsRouter:
|
|||
async def prediction_forwarder(self):
|
||||
logger.info("Starting prediction forwarder")
|
||||
while self.is_running.is_set():
|
||||
# timeout so that if no events occur, loop can still stop on is_running
|
||||
has_event = await self.prediction_socket.poll(timeout=1)
|
||||
if has_event:
|
||||
msg = await self.prediction_socket.recv_string()
|
||||
logger.debug(f"Forward prediction message of {len(msg)} chars")
|
||||
WebSocketPredictionHandler.write_to_clients(msg)
|
||||
|
|
Loading…
Reference in a new issue