diff options
author | notgne2 | 2021-12-04 17:53:10 -0700 |
---|---|---|
committer | GitHub | 2021-12-04 17:53:10 -0700 |
commit | 715e92a13018bc1745fb680b5860af0c5641026a (patch) | |
tree | 143e85fb6bb5a7b58b71533a2219631db31c3efe /src | |
parent | 9a02de4373e0ec272d08a417b269a28ac8b961b4 (diff) | |
parent | 629596964e5160a44d21e22cc59a5d80992a52ed (diff) |
Merge pull request #138 from input-output-hk/await-thread
ensure spawned thread exits before main
Diffstat (limited to '')
-rw-r--r-- | src/deploy.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/deploy.rs b/src/deploy.rs index f8fc2f9..5c4b656 100644 --- a/src/deploy.rs +++ b/src/deploy.rs @@ -363,7 +363,7 @@ pub async fn deploy_profile( let (send_activate, recv_activate) = tokio::sync::oneshot::channel(); let (send_activated, recv_activated) = tokio::sync::oneshot::channel(); - tokio::spawn(async move { + let thread = tokio::spawn(async move { let o = ssh_activate.wait_with_output().await; let maybe_err = match o { @@ -399,6 +399,10 @@ pub async fn deploy_profile( let c = confirm_profile(deploy_data, deploy_defs, temp_path, &ssh_addr).await; recv_activated.await.unwrap(); c?; + + thread + .await + .map_err(|x| DeployProfileError::SSHActivate(x.into()))?; } Ok(()) |