Skip to content

Commit 9dc7029

Browse files
feat(downloads): use spawn_blocking to allow the downloads to continue during installations
Co-authored-by: rami3l <rami3l@outlook.com>
1 parent bb27ecd commit 9dc7029

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/dist/manifestation.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,18 +308,21 @@ impl Manifestation {
308308
&& let Some(message) = download_rx.recv().await
309309
{
310310
let (component_bin, installer_file) = message?;
311-
current_tx = {
311+
current_tx = tokio::task::spawn_blocking({
312312
let this = self.clone();
313313
let new_manifest = new_manifest.clone();
314314
let download_cfg = download_cfg.clone();
315-
component_bin.install(
316-
installer_file,
317-
current_tx,
318-
&new_manifest,
319-
&this,
320-
&download_cfg,
321-
)
322-
}?;
315+
move || {
316+
component_bin.install(
317+
installer_file,
318+
current_tx,
319+
&new_manifest,
320+
&this,
321+
&download_cfg,
322+
)
323+
}
324+
})
325+
.await??;
323326
counter += 1;
324327
}
325328
Ok::<_, Error>(current_tx)

0 commit comments

Comments
 (0)