feat: unwatch_ohlcv - improved error handling
This commit is contained in:
@@ -84,6 +84,7 @@ class ExchangeWS:
|
|||||||
Remove history for a pair/timeframe combination from ccxt cache
|
Remove history for a pair/timeframe combination from ccxt cache
|
||||||
"""
|
"""
|
||||||
self._ccxt_object.ohlcvs.get(paircomb[0], {}).pop(paircomb[1], None)
|
self._ccxt_object.ohlcvs.get(paircomb[0], {}).pop(paircomb[1], None)
|
||||||
|
self.klines_last_refresh.pop(paircomb, None)
|
||||||
|
|
||||||
@retrier(retries=3)
|
@retrier(retries=3)
|
||||||
def ohlcvs(self, pair: str, timeframe: str) -> list[list]:
|
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:
|
async def _unwatch_ohlcv(self, pair: str, timeframe: str, candle_type: CandleType) -> None:
|
||||||
try:
|
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:
|
except ccxt.NotSupported as e:
|
||||||
logger.debug("un_watch_ohlcv_for_symbols not supported: %s", e)
|
logger.debug("un_watch_ohlcv_for_symbols not supported: %s", e)
|
||||||
pass
|
pass
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Exception in _unwatch_ohlcv")
|
||||||
|
|
||||||
def _continuous_stopped(
|
def _continuous_stopped(
|
||||||
self, task: asyncio.Task, pair: str, timeframe: str, candle_type: CandleType
|
self, task: asyncio.Task, pair: str, timeframe: str, candle_type: CandleType
|
||||||
|
|||||||
Reference in New Issue
Block a user