Skip to content

Commit 3b17403

Browse files
committed
rust: defer generation of install only archives
This should reduce timeouts due to expensive blocking operations.
1 parent b3993f1 commit 3b17403

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/github.rs

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
9494

9595
let mut buffered = futures::stream::iter(fs).buffer_unordered(4);
9696

97+
let mut install_paths = vec![];
98+
9799
while let Some(res) = buffered.next().await {
98100
let data = res?;
99101

@@ -142,24 +144,33 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
142144
println!("releasing {}", name);
143145

144146
if build_suffix == release.install_only_suffix {
145-
println!("producing install_only archive from {}", name);
146-
147-
let dest_path = produce_install_only(&dest_path)?;
148-
149-
println!(
150-
"releasing {}",
151-
dest_path
152-
.file_name()
153-
.expect("should have file name")
154-
.to_string_lossy()
155-
);
147+
install_paths.push(dest_path);
156148
}
157149
} else {
158150
println!("{} does not match any registered release triples", name);
159151
}
160152
}
161153
}
162154

155+
for path in install_paths {
156+
println!(
157+
"producing install_only archive from {}",
158+
path.file_name()
159+
.expect("should have file name")
160+
.to_string_lossy()
161+
);
162+
163+
let dest_path = produce_install_only(&path)?;
164+
165+
println!(
166+
"releasing {}",
167+
dest_path
168+
.file_name()
169+
.expect("should have file name")
170+
.to_string_lossy()
171+
);
172+
}
173+
163174
Ok(())
164175
}
165176

0 commit comments

Comments
 (0)