From 8e9d19379124c0d201c83912f69fec2dfe0b428a Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 23 Apr 2026 21:10:30 +0200 Subject: [PATCH] chore: improved shutdown wording --- freqtrade/exchange/exchange_ws.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/exchange/exchange_ws.py b/freqtrade/exchange/exchange_ws.py index f9c7f48f3..be78e31fa 100644 --- a/freqtrade/exchange/exchange_ws.py +++ b/freqtrade/exchange/exchange_ws.py @@ -52,19 +52,19 @@ class ExchangeWS: for task in self._background_tasks: task.cancel() if hasattr(self, "_loop") and not self._loop.is_closed(): - self.reset_connections() + self.reset_connections(cleanup=True) self._loop.call_soon_threadsafe(self._loop.stop) self._thread.join(timeout=5) if self._thread.is_alive(): logger.warning("Websocket loop thread did not stop within timeout.") logger.debug("Stopped") - def reset_connections(self) -> None: + def reset_connections(self, cleanup: bool = False) -> None: """ Reset all connections - avoids "connection-reset" errors that happen after ~9 days """ if hasattr(self, "_loop") and not self._loop.is_closed(): - logger.info("Resetting WS connections.") + logger.info(f"{'Cleaning up' if cleanup else 'Resetting'} exchange WS connections.") try: fut = asyncio.run_coroutine_threadsafe(self._cleanup_async(), loop=self._loop) fut.result(timeout=10) @@ -149,7 +149,7 @@ class ExchangeWS: logger.debug("un_watch_ohlcv_for_symbols not supported: %s", e) pass except Exception: - logger.exception("Exception in _unwatch_ohlcv") + logger.exception(f"Exception in _unwatch_ohlcv for {pair}, {timeframe},") def _continuous_stopped( self, task: asyncio.Task, pair: str, timeframe: str, candle_type: CandleType