Add 6, 6s retries on feed resets
parent
a5389beccd
commit
8d6c5b214e
|
@ -1592,21 +1592,27 @@ async def get_bars(
|
||||||
# # 'Market data farm connection is OK:usfuture'
|
# # 'Market data farm connection is OK:usfuture'
|
||||||
# 'Market data farm connection is OK:usfarm'
|
# 'Market data farm connection is OK:usfarm'
|
||||||
# )
|
# )
|
||||||
# TODO: some kinda resp here that indicates success
|
|
||||||
# otherwise retry?
|
|
||||||
# port = proxy._aio_ns.ib.client.port
|
# port = proxy._aio_ns.ib.client.port
|
||||||
await data_reset_hack()
|
await data_reset_hack()
|
||||||
|
|
||||||
# TODO: a while loop here if we timeout?
|
# try to wait on the reset event(s) to arrive, a timeout
|
||||||
for name, ev in [
|
# will trigger a retry up to 6 times (for now).
|
||||||
('history', hist_ev),
|
for i in range(6):
|
||||||
# ('live', live_ev),
|
with trio.move_on_after(6) as cs:
|
||||||
]:
|
for name, ev in [
|
||||||
await ev.wait()
|
('history', hist_ev),
|
||||||
log.info(f"{name} DATA RESET")
|
# ('live', live_ev),
|
||||||
|
]:
|
||||||
|
await ev.wait()
|
||||||
|
log.info(f"{name} DATA RESET")
|
||||||
|
break
|
||||||
|
|
||||||
fails += 1
|
fails += 1
|
||||||
continue
|
if cs.cancelled_caught:
|
||||||
|
log.warning(f'Data reset hack failed, retrying {i}...')
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -2554,7 +2560,6 @@ async def data_reset_hack(
|
||||||
async with asyncvnc.connect(
|
async with asyncvnc.connect(
|
||||||
'localhost',
|
'localhost',
|
||||||
port=5900,
|
port=5900,
|
||||||
force_video_mode='rgba',
|
|
||||||
) as client:
|
) as client:
|
||||||
|
|
||||||
client.mouse.click()
|
client.mouse.click()
|
||||||
|
|
Loading…
Reference in New Issue