From f2c6668e18ee46e169d49d6251397da05f8082d5 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 9 Apr 2020 13:16:56 -0700 Subject: [PATCH] fix api-discontinued breaking reports --- pyircbot/modules/StockPlay.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyircbot/modules/StockPlay.py b/pyircbot/modules/StockPlay.py index 0abc7c2..2d166e6 100644 --- a/pyircbot/modules/StockPlay.py +++ b/pyircbot/modules/StockPlay.py @@ -617,8 +617,6 @@ class PriceCache(object): self.providers.append(PROVIDER_TYPES[provider["provider"]](provider, self.log)) def get_price(self, symbol, thresh): - if symbol in self.unsupported: - return symbol = symbol.upper() # load from cache price = self._load_priceinfo(symbol) @@ -626,6 +624,9 @@ class PriceCache(object): if price and (thresh == -1 or time() - price.time < thresh): return price + if symbol in self.unsupported: + return + return self.api_fetch(symbol) def api_fetch(self, symbol):