Handle individual exceptions when initializing leverage tiers

closes #8515
closes #8512
closes #8514
This commit is contained in:
Matthias
2023-04-17 19:48:33 +02:00
parent d73e7f292a
commit b2ea464250

View File

@@ -2404,16 +2404,17 @@ class Exchange:
with self._loop_lock:
results = self.loop.run_until_complete(gather_results())
for symbol, res in results:
tiers[symbol] = res
for res in results:
if isinstance(res, Exception):
logger.warning(f"Leverage tier exception: {repr(res)}")
continue
symbol, tier = res
tiers[symbol] = tier
if len(coros) > 0:
self.cache_leverage_tiers(tiers, self._config['stake_currency'])
logger.info(f"Done initializing {len(symbols)} markets.")
return tiers
else:
return {}
else:
return {}
def cache_leverage_tiers(self, tiers: Dict[str, List[Dict]], stake_currency: str) -> None: