Avoid loop error during ccxt tests
This commit is contained in:
parent
e7902bffa0
commit
c615e1bc62
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user