diff options
author | Timothy DeHerrera | 2021-11-18 10:45:31 -0700 |
---|---|---|
committer | Timothy DeHerrera | 2021-11-18 10:45:31 -0700 |
commit | 629596964e5160a44d21e22cc59a5d80992a52ed (patch) | |
tree | 143e85fb6bb5a7b58b71533a2219631db31c3efe /src | |
parent | 9a02de4373e0ec272d08a417b269a28ac8b961b4 (diff) |
ensure spawned thread exits before main
Diffstat (limited to 'src')
-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(()) |