Skip to content

Commit 715e92a

Browse files
authored
Merge pull request #138 from input-output-hk/await-thread
ensure spawned thread exits before main
2 parents 9a02de4 + 6295969 commit 715e92a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/deploy.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pub async fn deploy_profile(
363363
let (send_activate, recv_activate) = tokio::sync::oneshot::channel();
364364
let (send_activated, recv_activated) = tokio::sync::oneshot::channel();
365365

366-
tokio::spawn(async move {
366+
let thread = tokio::spawn(async move {
367367
let o = ssh_activate.wait_with_output().await;
368368

369369
let maybe_err = match o {
@@ -399,6 +399,10 @@ pub async fn deploy_profile(
399399
let c = confirm_profile(deploy_data, deploy_defs, temp_path, &ssh_addr).await;
400400
recv_activated.await.unwrap();
401401
c?;
402+
403+
thread
404+
.await
405+
.map_err(|x| DeployProfileError::SSHActivate(x.into()))?;
402406
}
403407

404408
Ok(())

0 commit comments

Comments
 (0)