mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
ruff: Fix SIM113 Use enumerate() for index variable in for loop.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 53e80c41ea)
This commit is contained in:
committed by
Tim Abbott
parent
3f9e4bd54b
commit
230574ebbf
@@ -634,12 +634,10 @@ def run_parallel_wrapper(
|
||||
logging.info("Distributing %s items across %s threads", len(full_items), threads)
|
||||
|
||||
with ProcessPoolExecutor(max_workers=threads) as executor:
|
||||
count = 0
|
||||
for future in as_completed(
|
||||
executor.submit(wrapping_function, f, item) for item in full_items
|
||||
for count, future in enumerate(
|
||||
as_completed(executor.submit(wrapping_function, f, item) for item in full_items), 1
|
||||
):
|
||||
future.result()
|
||||
count += 1
|
||||
if count % 1000 == 0:
|
||||
logging.info("Finished %s items", count)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user