From 44d798239d823538344f15ad7d2f6b9e965c64ef Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 11 Feb 2025 08:28:47 +0100 Subject: [PATCH] feat: unwatch_ohlcv - improved error handling --- freqtrade/exchange/exchange_ws.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange_ws.py b/freqtrade/exchange/exchange_ws.py index 925e3b4fc..cbc9772a3 100644 --- a/freqtrade/exchange/exchange_ws.py +++ b/freqtrade/exchange/exchange_ws.py @@ -84,6 +84,7 @@ class ExchangeWS: Remove history for a pair/timeframe combination from ccxt cache """ self._ccxt_object.ohlcvs.get(paircomb[0], {}).pop(paircomb[1], None) + self.klines_last_refresh.pop(paircomb, None) @retrier(retries=3) def ohlcvs(self, pair: str, timeframe: str) -> list[list]: @@ -140,10 +141,12 @@ class ExchangeWS: async def _unwatch_ohlcv(self, pair: str, timeframe: str, candle_type: CandleType) -> None: try: - await self.ccxt_object.un_watch_ohlcv_for_symbols([[pair, timeframe]]) + await self._ccxt_object.un_watch_ohlcv_for_symbols([[pair, timeframe]]) except ccxt.NotSupported as e: logger.debug("un_watch_ohlcv_for_symbols not supported: %s", e) pass + except Exception: + logger.exception("Exception in _unwatch_ohlcv") def _continuous_stopped( self, task: asyncio.Task, pair: str, timeframe: str, candle_type: CandleType