aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy DeHerrera2021-11-18 10:45:31 -0700
committerTimothy DeHerrera2021-11-18 10:45:31 -0700
commit629596964e5160a44d21e22cc59a5d80992a52ed (patch)
tree143e85fb6bb5a7b58b71533a2219631db31c3efe /src
parent9a02de4373e0ec272d08a417b269a28ac8b961b4 (diff)
ensure spawned thread exits before main
Diffstat (limited to 'src')
-rw-r--r--src/deploy.rs6
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(())