From 060cba303f392233554f1744ea4714ec09c51fa5 Mon Sep 17 00:00:00 2001 From: Trezy Date: Fri, 22 May 2026 01:23:16 -0500 Subject: [PATCH] feat: make backfill collection discovery concurrent Signed-off-by: Trezy --- src/admin/backfill.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/admin/backfill.rs b/src/admin/backfill.rs index 27b2b01..ba27f63 100644 --- a/src/admin/backfill.rs +++ b/src/admin/backfill.rs @@ -282,14 +282,16 @@ async fn run_discovery_phase( }, ); } else { - for collection in collections { - if is_cancelled(state, job_id).await { - return; - } - if let Err(e) = discover_repos_from_relay(state, job_id, collection).await { - tracing::warn!(collection, error = %e, "failed to discover repos, skipping"); - } - } + stream::iter(collections.iter()) + .for_each_concurrent(collections.len(), |collection| async move { + if is_cancelled(state, job_id).await { + return; + } + if let Err(e) = discover_repos_from_relay(state, job_id, collection).await { + tracing::warn!(collection, error = %e, "failed to discover repos, skipping"); + } + }) + .await; } let total = count_repos(state, job_id).await; -- 2.51.2