Skip to content

Commit

Permalink
Fix orders cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ml31415 committed May 7, 2024
1 parent f92beac commit f50931c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion betfair_parser/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def update(self, orc: OrderRunnerChange) -> None:
if orc.mb:
ladder_update_mo(self.matched_backs, orc.mb)
if orc.ml:
ladder_update_mo(self.matched_backs, orc.ml)
ladder_update_mo(self.matched_lays, orc.ml)


class MarketOrders(_DefaultDict):
Expand Down Expand Up @@ -284,6 +284,9 @@ def update(self, ocm: OCM) -> None:
if oc.closed:
# TODO: Call some hooks?
self.orders.pop(oc.id, None)
if not oc.orc:
# on closed markets
continue
for orc in oc.orc:
if orc.full_image:
self.orders[oc.id].pop(orc.id, None)
Expand Down

0 comments on commit f50931c

Please sign in to comment.