chore: improve naming for refresh_latest_trades

This commit is contained in:
Matthias
2024-08-12 19:43:48 +02:00
parent a840969512
commit 5cb6c234c4

View File

@@ -2787,16 +2787,16 @@ class Exchange:
) )
logger.debug("Refreshing TRADES data for %d pairs", len(pair_list)) logger.debug("Refreshing TRADES data for %d pairs", len(pair_list))
results_df = {} results_df = {}
coros = [] trades_dl_jobs = []
for pairwt in set(pair_list): for pair_wt in set(pair_list):
coros.append(self._build_trades_dl_jobs(pairwt, data_handler, cache)) trades_dl_jobs.append(self._build_trades_dl_jobs(pair_wt, data_handler, cache))
async def gather_stuff(coro): async def gather_coroutines(coro):
return await asyncio.gather(*coro, return_exceptions=True) return await asyncio.gather(*coro, return_exceptions=True)
for input_coro in chunks(coros, 100): for dl_job_chunk in chunks(trades_dl_jobs, 100):
with self._loop_lock: with self._loop_lock:
results = self.loop.run_until_complete(gather_stuff(input_coro)) results = self.loop.run_until_complete(gather_coroutines(dl_job_chunk))
for res in results: for res in results:
if isinstance(res, Exception): if isinstance(res, Exception):