From 2dc55e89e6a1fb1baba7631020941120efeea586 Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Wed, 2 Nov 2022 15:25:39 -0600 Subject: [PATCH] better error handling channel send --- freqtrade/rpc/api_server/ws/channel.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/rpc/api_server/ws/channel.py b/freqtrade/rpc/api_server/ws/channel.py index e69e51e86..417b7725a 100644 --- a/freqtrade/rpc/api_server/ws/channel.py +++ b/freqtrade/rpc/api_server/ws/channel.py @@ -78,11 +78,12 @@ class WebSocketChannel: self.queue.put(data), timeout=self.drain_timeout ) - return True - except Exception: - # We must catch any exception here to prevent an exception bubbling - # up and stalling the broadcast thread + except asyncio.TimeoutError: return False + except RuntimeError: + pass + + return True async def recv(self): """