Skip to content

Commit 5b8e05a

Browse files
feat(downloads): use spawn_blocking to allow the downloads to continue during installations
Co-authored-by: rami3l <[email protected]>
1 parent da0113e commit 5b8e05a

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/dist/manifestation.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,21 +285,24 @@ impl Manifestation {
285285
let (component, format, installer_file) = message?;
286286
let component_name = component.short_name(&new_manifest);
287287
let notify_handler = Arc::clone(&download_cfg.notify_handler);
288-
current_tx = {
288+
current_tx = tokio::task::spawn_blocking({
289289
let this = Arc::clone(&self);
290290
let new_manifest = Arc::clone(&new_manifest);
291291
let tmp_cx = Arc::clone(&download_cfg.tmp_cx);
292292
let download_cfg = Arc::clone(&download_cfg);
293-
this.install_component(
294-
component,
295-
format,
296-
installer_file,
297-
tmp_cx,
298-
download_cfg,
299-
new_manifest,
300-
current_tx,
301-
)
302-
}?;
293+
move || {
294+
this.install_component(
295+
component,
296+
format,
297+
installer_file,
298+
tmp_cx,
299+
download_cfg,
300+
new_manifest,
301+
current_tx,
302+
)
303+
}
304+
})
305+
.await??;
303306
(notify_handler)(Notification::ComponentInstalled(
304307
&component_name,
305308
&self.target_triple,

0 commit comments

Comments
 (0)