Convert contractsto dicts on errors

basic_orders
Tyler Goodlet 2021-01-26 13:34:49 -05:00
parent 5a0612e6a8
commit 708086cbcb
1 changed files with 6 additions and 1 deletions

View File

@ -819,7 +819,7 @@ async def fill_bars(
first_bars: list, first_bars: list,
shm: 'ShmArray', # type: ignore # noqa shm: 'ShmArray', # type: ignore # noqa
# count: int = 20, # NOTE: any more and we'll overrun underlying buffer # count: int = 20, # NOTE: any more and we'll overrun underlying buffer
count: int = 2, # NOTE: any more and we'll overrun the underlying buffer count: int = 6, # NOTE: any more and we'll overrun the underlying buffer
) -> None: ) -> None:
"""Fill historical bars into shared mem / storage afap. """Fill historical bars into shared mem / storage afap.
@ -1177,4 +1177,9 @@ async def stream_trades(
elif event_name == 'error': elif event_name == 'error':
msg = item msg = item
# f$#$% gawd dammit insync..
con = msg['contract']
if isinstance(con, Contract):
msg['contract'] = asdict(con)
yield {'local_trades': (event_name, msg)} yield {'local_trades': (event_name, msg)}