From dd5e1e7ea7ad9c4b1666f28a7823359c91f4231a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 18 Apr 2018 13:31:07 -0400 Subject: [PATCH] Doh, set sleeptime after adjusting the rate limit --- piker/brokers/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piker/brokers/core.py b/piker/brokers/core.py index 2dc1f809..5a4c9140 100644 --- a/piker/brokers/core.py +++ b/piker/brokers/core.py @@ -139,14 +139,14 @@ async def poll_tickers( A broker-client ``quoter`` async context manager must be provided which returns an async quote function. """ - sleeptime = round(1. / rate, 3) - _cache = {} # ticker to quote caching - broker_limit = getattr(brokermod, '_rate_limit', float('inf')) if broker_limit < rate: rate = broker_limit log.warn(f"Limiting {brokermod.__name__} query rate to {rate}/sec") + sleeptime = round(1. / rate, 3) + _cache = {} # ticker to quote caching + while True: # use an event here to trigger exit? prequote_start = time.time()