Avoid loop error during ccxt tests

This commit is contained in:
Matthias 2022-08-17 14:31:40 +02:00
parent e7902bffa0
commit c615e1bc62

View File

@ -2255,10 +2255,14 @@ class Exchange:
coros = [self.get_market_leverage_tiers(symbol) for symbol in sorted(symbols)] coros = [self.get_market_leverage_tiers(symbol) for symbol in sorted(symbols)]
async def gather_results():
return await asyncio.gather(*input_coro, return_exceptions=True)
for input_coro in chunks(coros, 100): for input_coro in chunks(coros, 100):
results = self.loop.run_until_complete( with self._loop_lock:
asyncio.gather(*input_coro, return_exceptions=True)) results = self.loop.run_until_complete(gather_results())
for symbol, res in results: for symbol, res in results:
tiers[symbol] = res tiers[symbol] = res