Only warn on slow quote query
parent
0bcaeda784
commit
0e4a7e3846
|
@ -505,8 +505,14 @@ class Client:
|
|||
)
|
||||
|
||||
# ensure a last price gets filled in before we deliver quote
|
||||
while isnan(ticker.last):
|
||||
for _ in range(25):
|
||||
if isnan(ticker.last):
|
||||
ticker = await ticker.updateEvent
|
||||
await asyncio.sleep(0.2)
|
||||
else:
|
||||
log.warning(
|
||||
f'Symbol {symbol} is not returning a quote '
|
||||
'it may be outside trading hours?')
|
||||
|
||||
details = (await details_fute)[0]
|
||||
return contract, ticker, details
|
||||
|
@ -1350,6 +1356,7 @@ async def stream_quotes(
|
|||
# TODO: support multiple subscriptions
|
||||
sym = symbols[0]
|
||||
|
||||
with trio.fail_after(3):
|
||||
contract, first_ticker, details = await _trio_run_client_method(
|
||||
method='get_quote',
|
||||
symbol=sym,
|
||||
|
|
Loading…
Reference in New Issue