Skip to content

Commit 44d7982

Browse files
committed
feat: unwatch_ohlcv - improved error handling
1 parent 08e1a61 commit 44d7982

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

freqtrade/exchange/exchange_ws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def _pop_history(self, paircomb: PairWithTimeframe) -> None:
8484
Remove history for a pair/timeframe combination from ccxt cache
8585
"""
8686
self._ccxt_object.ohlcvs.get(paircomb[0], {}).pop(paircomb[1], None)
87+
self.klines_last_refresh.pop(paircomb, None)
8788

8889
@retrier(retries=3)
8990
def ohlcvs(self, pair: str, timeframe: str) -> list[list]:
@@ -140,10 +141,12 @@ async def _schedule_while_true(self) -> None:
140141

141142
async def _unwatch_ohlcv(self, pair: str, timeframe: str, candle_type: CandleType) -> None:
142143
try:
143-
await self.ccxt_object.un_watch_ohlcv_for_symbols([[pair, timeframe]])
144+
await self._ccxt_object.un_watch_ohlcv_for_symbols([[pair, timeframe]])
144145
except ccxt.NotSupported as e:
145146
logger.debug("un_watch_ohlcv_for_symbols not supported: %s", e)
146147
pass
148+
except Exception:
149+
logger.exception("Exception in _unwatch_ohlcv")
147150

148151
def _continuous_stopped(
149152
self, task: asyncio.Task, pair: str, timeframe: str, candle_type: CandleType

0 commit comments

Comments
 (0)