Skip to content

Commit

Permalink
[feed] !allowFailure should not use the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Jul 1, 2016
1 parent 4943b97 commit 972a951
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/pricefeeds/feedsources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 972a951

Please sign in to comment.