Skip to content

Commit

Permalink
Betfair bugfix: Reload cache as a dict of venue and client order ids (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
imemo88 authored Apr 24, 2024
1 parent b80d881 commit 536d647
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nautilus_trader/adapters/betfair/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ async def load_venue_id_mapping_from_cache(self) -> None:
self._log.info("Loading venue_id mapping from cache")
raw = self._cache.get("betfair_execution_client.venue_order_id_to_client_order_id") or b"{}"
self._log.info(f"venue_id_mapping: {raw.decode()=}")
self.venue_order_id_to_client_order_id = msgspec.json.decode(raw)
self.venue_order_id_to_client_order_id = {
VenueOrderId(k): ClientOrderId(v) for k, v in msgspec.json.decode(raw).items()
}

def set_venue_id_mapping(
self,
Expand Down

0 comments on commit 536d647

Please sign in to comment.