From e92632bd34679ee6d24e4ce5e16946621d3ef83f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 10 Apr 2022 21:51:22 -0400 Subject: [PATCH] Remove old commented nan checking lines --- piker/clearing/_ems.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/piker/clearing/_ems.py b/piker/clearing/_ems.py index 5ea19726..07de4a6b 100644 --- a/piker/clearing/_ems.py +++ b/piker/clearing/_ems.py @@ -20,7 +20,6 @@ In da suit parlances: "Execution management systems" """ from contextlib import asynccontextmanager from dataclasses import dataclass, field -# from math import isnan from pprint import pformat import time from typing import AsyncIterator, Callable @@ -491,8 +490,9 @@ async def open_brokerd_trades_dialogue( finally: # parent context must have been closed # remove from cache so next client will respawn if needed - ## TODO: Maybe add a warning - _router.relays.pop(broker, None) + relay = _router.relays.pop(broker, None) + if not relay: + log.warning(f'Relay for {broker} was already removed!?') @tractor.context @@ -1036,11 +1036,6 @@ async def _emsd_main( book = _router.get_dark_book(broker) book.lasts[fqsn] = first_quote['last'] - # XXX: ib is a cucker but we've fixed avoiding receiving any - # `Nan`s in the backend during market hours (right?). this was - # here previously as a sanity check during market hours. - # assert not isnan(last) - # open a stream with the brokerd backend for order # flow dialogue async with (