Handle individual exceptions when initializing leverage tiers
closes #8515 closes #8512 closes #8514
This commit is contained in:
@@ -2404,17 +2404,18 @@ class Exchange:
|
|||||||
with self._loop_lock:
|
with self._loop_lock:
|
||||||
results = self.loop.run_until_complete(gather_results())
|
results = self.loop.run_until_complete(gather_results())
|
||||||
|
|
||||||
for symbol, res in results:
|
for res in results:
|
||||||
tiers[symbol] = res
|
if isinstance(res, Exception):
|
||||||
|
logger.warning(f"Leverage tier exception: {repr(res)}")
|
||||||
|
continue
|
||||||
|
symbol, tier = res
|
||||||
|
tiers[symbol] = tier
|
||||||
if len(coros) > 0:
|
if len(coros) > 0:
|
||||||
self.cache_leverage_tiers(tiers, self._config['stake_currency'])
|
self.cache_leverage_tiers(tiers, self._config['stake_currency'])
|
||||||
logger.info(f"Done initializing {len(symbols)} markets.")
|
logger.info(f"Done initializing {len(symbols)} markets.")
|
||||||
|
|
||||||
return tiers
|
return tiers
|
||||||
else:
|
return {}
|
||||||
return {}
|
|
||||||
else:
|
|
||||||
return {}
|
|
||||||
|
|
||||||
def cache_leverage_tiers(self, tiers: Dict[str, List[Dict]], stake_currency: str) -> None:
|
def cache_leverage_tiers(self, tiers: Dict[str, List[Dict]], stake_currency: str) -> None:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user