Improve fiat-convert behavior in case of coingecko outage
This commit is contained in:
parent
fab6b2f105
commit
a5bf34587a
@ -46,7 +46,9 @@ class CryptoToFiatConverter(LoggingMixin):
|
|||||||
if CryptoToFiatConverter.__instance is None:
|
if CryptoToFiatConverter.__instance is None:
|
||||||
CryptoToFiatConverter.__instance = object.__new__(cls)
|
CryptoToFiatConverter.__instance = object.__new__(cls)
|
||||||
try:
|
try:
|
||||||
CryptoToFiatConverter._coingekko = CoinGeckoAPI()
|
# Limit retires to 1 (0 and 1)
|
||||||
|
# otherwise we risk bot impact if coingecko is down.
|
||||||
|
CryptoToFiatConverter._coingekko = CoinGeckoAPI(retries=1)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
CryptoToFiatConverter._coingekko = None
|
CryptoToFiatConverter._coingekko = None
|
||||||
return CryptoToFiatConverter.__instance
|
return CryptoToFiatConverter.__instance
|
||||||
|
Loading…
Reference in New Issue
Block a user