Skip to content

Commit

Permalink
Run in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Oct 20, 2024
1 parent 9592bb1 commit 22e4181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/pypi_data/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ async def _run(r: CodeRepository) -> CodeRepository | None:

async with asyncio.TaskGroup() as tg:
tasks = [tg.create_task(_run(repo)) for repo in repositories]
for res in tasks:
res = await res
if res is not None:
results.append(res)

for res in tasks:
res = res.result()
if res is not None:
results.append(res)

log.info(f"Fetched {len(tasks)} repository indexes")
return results

Expand Down
1 change: 0 additions & 1 deletion src/pypi_data/combine_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ async def fill_buffer(
time_hashing_ns = 0
time_iterating_ns = 0
time_loading_ns = 0
time_downloading_ns = 0

start_time_ns = time.perf_counter_ns()

Expand Down

0 comments on commit 22e4181

Please sign in to comment.