Skip to content

Commit 468d089

Browse files
committed
rust: use a BufferUnordered when retrieving content
1 parent 85e1aa4 commit 468d089

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/github.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use {
66
anyhow::{anyhow, Result},
77
clap::ArgMatches,
8+
futures::StreamExt,
89
octocrab::OctocrabBuilder,
910
once_cell::sync::Lazy,
1011
serde::Deserialize,
@@ -144,7 +145,9 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches<'_>) -> Resul
144145
}
145146
}
146147

147-
for res in futures::future::join_all(fs).await {
148+
let mut buffered = futures::stream::iter(fs).buffer_unordered(4);
149+
150+
while let Some(res) = buffered.next().await {
148151
let data = res?;
149152

150153
let mut za = ZipArchive::new(std::io::Cursor::new(data))?;

0 commit comments

Comments
 (0)