Handle race with order-request-ack msg

pause_feeds_on_sym_switch
Tyler Goodlet 2021-08-29 12:23:01 -04:00
parent 1d1b13bce0
commit 5dc2f93a7e
1 changed files with 4 additions and 3 deletions

View File

@ -576,7 +576,8 @@ async def translate_and_relay_brokerd_events(
# cancelled by the ems controlling client before we
# received this ack, in which case we relay that cancel
# signal **asap** to the backend broker
if entry.action == 'cancel':
action = getattr(entry, 'action', None)
if action and action == 'cancel':
# assign newly providerd broker backend request id
entry.reqid = reqid
@ -966,10 +967,10 @@ async def _emsd_main(
):
# XXX: this should be initial price quote from target provider
first_quote = feed.first_quote
first_quote = feed.first_quotes[symbol]
book = _router.get_dark_book(broker)
book.lasts[(broker, symbol)] = first_quote[symbol]['last']
book.lasts[(broker, symbol)] = first_quote['last']
# open a stream with the brokerd backend for order
# flow dialogue