simple bypass for soft failure

mm-logging
lza_menace 4 years ago
parent e195319cdf
commit bf20f634b3

@ -32,17 +32,20 @@ class Cache(object):
} }
headers = {'accept': 'application/json'} headers = {'accept': 'application/json'}
url = 'https://api.coingecko.com/api/v3/coins/wownero' url = 'https://api.coingecko.com/api/v3/coins/wownero'
r = r_get(url, headers=headers, data=data) try:
info = { r = r_get(url, headers=headers, data=data)
'genesis_date': r.json()['genesis_date'], info = {
'market_cap_rank': r.json()['market_cap_rank'], 'genesis_date': r.json()['genesis_date'],
'current_price': r.json()['market_data']['current_price']['usd'], 'market_cap_rank': r.json()['market_cap_rank'],
'market_cap': r.json()['market_data']['market_cap']['usd'], 'current_price': r.json()['market_data']['current_price']['usd'],
'market_cap_rank': r.json()['market_data']['market_cap_rank'], 'market_cap': r.json()['market_data']['market_cap']['usd'],
'total_volume': r.json()['market_data']['total_volume']['usd'], 'market_cap_rank': r.json()['market_data']['market_cap_rank'],
'last_updated': r.json()['last_updated'] 'total_volume': r.json()['market_data']['total_volume']['usd'],
} 'last_updated': r.json()['last_updated']
self.store_data("coin_info", 15, json_dumps(info)) }
return info self.store_data("coin_info", 15, json_dumps(info))
return info
except:
return {}
cache = Cache() cache = Cache()

Loading…
Cancel
Save