diff --git a/src/tool/subcommands/archive_cmd.rs b/src/tool/subcommands/archive_cmd.rs index 4b5c78e2b77..59e52a3f61e 100644 --- a/src/tool/subcommands/archive_cmd.rs +++ b/src/tool/subcommands/archive_cmd.rs @@ -598,7 +598,14 @@ where diff_limit, FileBackedCidHashSet::new_in_temp_dir()?, ); - while stream.try_next().await?.is_some() {} + let mut i: usize = 0; + while stream.try_next().await?.is_some() { + i += 1; + if i.is_multiple_of(128) { + // To make the task cancellable + tokio::task::yield_now().await; + } + } stream.into_seen() } else { FileBackedCidHashSet::new_in_temp_dir()?