From 48242ca02b0f819d0d0318e89ad2b1804017b076 Mon Sep 17 00:00:00 2001 From: Timothy Pogue Date: Tue, 22 Nov 2022 12:43:45 -0700 Subject: [PATCH] update catch block in cancel channel tasks --- freqtrade/rpc/api_server/ws/channel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/freqtrade/rpc/api_server/ws/channel.py b/freqtrade/rpc/api_server/ws/channel.py index 9dea21f3b..ad183ce5b 100644 --- a/freqtrade/rpc/api_server/ws/channel.py +++ b/freqtrade/rpc/api_server/ws/channel.py @@ -99,7 +99,7 @@ class WebSocketChannel: self._calc_send_limit() except asyncio.TimeoutError: - logger.info(f"Connection for {self} is too far behind, disconnecting") + logger.info(f"Connection for {self} timed out, disconnecting") raise # Without this sleep, messages would send to one channel @@ -138,7 +138,7 @@ class WebSocketChannel: try: await self._websocket.close() - except Exception: + except RuntimeError: pass def is_closed(self) -> bool: @@ -196,8 +196,10 @@ class WebSocketChannel: await task except ( asyncio.CancelledError, + asyncio.TimeoutError, WebSocketDisconnect, - ConnectionClosed + ConnectionClosed, + RuntimeError ): pass except Exception as e: