Add type annotation for open_ping_task'

kucoin_backend
jaredgoldman 2023-04-19 14:47:19 -04:00
parent fcdddadec1
commit d07a73cf70
1 changed files with 7 additions and 5 deletions

View File

@ -462,7 +462,10 @@ async def open_symbol_search(
@acm @acm
async def open_ping_task(ws: wsproto.WSConnection, ping_interval, connect_id): async def open_ping_task(
ws: wsproto.WSConnection,
ping_interval, connect_id
) -> AsyncGenerator[None, None]:
''' '''
Spawn a non-blocking task that pings the ws Spawn a non-blocking task that pings the ws
server every ping_interval so Kucoin doesn't drop server every ping_interval so Kucoin doesn't drop
@ -678,7 +681,9 @@ async def open_history_client(
end_dt: datetime | None = None, end_dt: datetime | None = None,
start_dt: datetime | None = None, start_dt: datetime | None = None,
) -> tuple[ ) -> tuple[
np.ndarray, datetime | None, datetime | None np.ndarray, datetime |
None, datetime |
None
]: # start # end ]: # start # end
if timeframe != 60: if timeframe != 60:
raise DataUnavailable('Only 1m bars are supported') raise DataUnavailable('Only 1m bars are supported')
@ -699,9 +704,6 @@ async def open_history_client(
f'{inow - times[-1]}' f'{inow - times[-1]}'
) )
if (inow - times[-1]) > 60:
await tractor.breakpoint()
start_dt = pendulum.from_timestamp(times[0]) start_dt = pendulum.from_timestamp(times[0])
end_dt = pendulum.from_timestamp(times[-1]) end_dt = pendulum.from_timestamp(times[-1])