forked from DGNum/colmena
nix: Another deployment parallelization oops
This commit is contained in:
parent
2bba64a002
commit
a3e292d7fb
1 changed files with 5 additions and 5 deletions
|
@ -329,17 +329,16 @@ impl Deployment {
|
||||||
|
|
||||||
let nodes = vec![target.name.clone()];
|
let nodes = vec![target.name.clone()];
|
||||||
|
|
||||||
|
let permit = self.parallelism_limit.apply.acquire().await.unwrap();
|
||||||
|
|
||||||
let push_job = parent.create_job(JobType::Push, nodes.clone())?;
|
let push_job = parent.create_job(JobType::Push, nodes.clone())?;
|
||||||
let push_profile = profile.clone();
|
let push_profile = profile.clone();
|
||||||
let arc_self = self.clone();
|
let arc_self = self.clone();
|
||||||
let mut target = push_job.run_waiting(|job| async move {
|
let mut target = push_job.run(|job| async move {
|
||||||
if target.host.is_none() {
|
if target.host.is_none() {
|
||||||
return Err(NixError::Unsupported);
|
return Err(NixError::Unsupported);
|
||||||
}
|
}
|
||||||
|
|
||||||
let permit = arc_self.parallelism_limit.apply.acquire().await.unwrap();
|
|
||||||
job.state(JobState::Running)?;
|
|
||||||
|
|
||||||
let host = target.host.as_mut().unwrap();
|
let host = target.host.as_mut().unwrap();
|
||||||
host.set_job(Some(job.clone()));
|
host.set_job(Some(job.clone()));
|
||||||
host.copy_closure(
|
host.copy_closure(
|
||||||
|
@ -347,7 +346,6 @@ impl Deployment {
|
||||||
CopyDirection::ToRemote,
|
CopyDirection::ToRemote,
|
||||||
arc_self.options.to_copy_options()).await?;
|
arc_self.options.to_copy_options()).await?;
|
||||||
|
|
||||||
drop(permit);
|
|
||||||
Ok(target)
|
Ok(target)
|
||||||
}).await?;
|
}).await?;
|
||||||
|
|
||||||
|
@ -441,6 +439,8 @@ impl Deployment {
|
||||||
}).await?;
|
}).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drop(permit);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue