Skip to content

Commit

Permalink
ib: pack empty dict on no flow entry
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Aug 25, 2023
1 parent c3f8b08 commit 9005335
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions piker/brokers/ib/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ async def deliver_trade_events(
if err['reqid'] == -1:
log.error(f'TWS external order error:\n{pformat(err)}')

flow: ChainMap = flows.get(reqid)
flow: dict = dict(flows.get(reqid)) or {}

# TODO: we don't want to relay data feed / lookup errors
# so we need some further filtering logic here..
Expand All @@ -1260,7 +1260,7 @@ async def deliver_trade_events(
reason=reason,
broker_details={
'name': 'ib',
'flow': dict(flow),
'flow': flow,
},
)
flows.add_msg(reqid, err_msg.to_dict())
Expand Down

0 comments on commit 9005335

Please sign in to comment.