From 972a9516433d852af51411ce976dfea8a637da2b Mon Sep 17 00:00:00 2001 From: Fabian Schuh Date: Fri, 1 Jul 2016 09:07:34 +0200 Subject: [PATCH] [feed] !allowFailure should not use the cache --- scripts/pricefeeds/feedsources.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/pricefeeds/feedsources.py b/scripts/pricefeeds/feedsources.py index a5f87e1f..6f194142 100644 --- a/scripts/pricefeeds/feedsources.py +++ b/scripts/pricefeeds/feedsources.py @@ -40,11 +40,15 @@ def fetch(self): return feed except Exception as e: print("\n{1} We encountered an error loading live data. Trying to recover from cache! ({0})".format(str(e), type(self).__name__)) + + # Terminate if not allow Failure + if not self.allowFailure: + sys.exit("\nExiting due to exchange importance!") + try: return self.recoverFromCache() except: - if not self.allowFailure: - sys.exit("\nExiting due to exchange importance!") + print("We were unable to fetch live or cached data from %s. Skipping", type(self).__name__) def today(self): return datetime.datetime.strftime(datetime.datetime.now(), "%Y-%m-%d")