Make `binance` reject 1s OHLC history requests

ib_1m_hist
Tyler Goodlet 2022-10-26 10:30:12 -04:00
parent 553d0557b6
commit a1a24da7b6
1 changed files with 7 additions and 1 deletions

View File

@ -36,7 +36,11 @@ import tractor
import wsproto import wsproto
from .._cacheables import open_cached_client from .._cacheables import open_cached_client
from ._util import resproc, SymbolNotFound from ._util import (
resproc,
SymbolNotFound,
DataUnavailable,
)
from ..log import get_logger, get_console_log from ..log import get_logger, get_console_log
from ..data import ShmArray from ..data import ShmArray
from ..data.types import Struct from ..data.types import Struct
@ -397,6 +401,8 @@ async def open_history_client(
datetime, # start datetime, # start
datetime, # end datetime, # end
]: ]:
if timeframe != 60:
raise DataUnavailable('Only 1m bars are supported')
array = await client.bars( array = await client.bars(
symbol, symbol,