summaryrefslogtreecommitdiffstats
path: root/src/orchestrator
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-14 13:37:02 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-14 13:37:05 +0100
commit2de687ac49c1d9aa48334d9cc0550f65ddfc96f3 (patch)
tree9f61e843120338755cd35a928ab896985447b439 /src/orchestrator
parent5162a8659d6f62181daa7d8d92482ac5c9505399 (diff)
Move multibar creation back to orchestrator
This needs to be done to prepare for one thing: We need to be able to call `multibar.join()` (which blocks the current thread) _while_ running the jobs on the scheduler. That's ugly, but that's the way indicatif works. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/orchestrator')
-rw-r--r--src/orchestrator/orchestrator.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index d68cfde..6d8ff11 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -75,6 +75,8 @@ impl Orchestrator {
let number_of_jobsets = self.jobsets.len();
let database = self.database;
+ let multibar = indicatif::MultiProgress::new();
+
for (i, jobset) in self.jobsets.into_iter().enumerate() {
let merged_store = MergedStores::new(self.release_store.clone(), self.staging_store.clone());
@@ -85,7 +87,7 @@ impl Orchestrator {
let job_id = runnable.uuid().clone();
trace!("Runnable {} for package {}", job_id, runnable.package().name());
- let jobhandle = self.scheduler.schedule_job(runnable).await?;
+ let jobhandle = self.scheduler.schedule_job(runnable, &multibar).await?;
trace!("Jobhandle -> {:?}", jobhandle);
// clone the bar here, so we can give a handle to the async result fetcher closure
@@ -125,8 +127,8 @@ impl Orchestrator {
let mut results = results; // rebind!
report_result.append(&mut results);
}
+ multibar.join()?;
- self.scheduler.shutdown()?;
Ok(report_result)
}