File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2449,7 +2449,11 @@ def _can_use_websocket(
24492449 Check if we can use websocket for this pair.
24502450 Acts as typeguard for exchangeWs
24512451 """
2452- if self ._has_watch_ohlcv and exchange_ws :
2452+ if (
2453+ self ._has_watch_ohlcv
2454+ and exchange_ws
2455+ and candle_type in (CandleType .SPOT , CandleType .FUTURES )
2456+ ):
24532457 return True
24542458 return False
24552459
@@ -2462,7 +2466,7 @@ def _build_coroutine(
24622466 cache : bool ,
24632467 ) -> Coroutine [Any , Any , OHLCVResponse ]:
24642468 not_all_data = cache and self .required_candle_call_count > 1
2465- if cache and candle_type in ( CandleType . SPOT , CandleType . FUTURES ) :
2469+ if cache :
24662470 if self ._can_use_websocket (self ._exchange_ws , pair , timeframe , candle_type ):
24672471 # Subscribe to websocket
24682472 self ._exchange_ws .schedule_ohlcv (pair , timeframe , candle_type )
You can’t perform that action at this time.
0 commit comments