summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/orchestrator.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-02-02 14:45:54 +0100
committerMatthias Beyer <matthias.beyer@atos.net>2021-02-02 14:45:54 +0100
commit21599575558fe2f456265d1b2381eab6184c7dbd (patch)
treedb0b9c378d7b7c47356f7147edb4107d964e8e84 /src/orchestrator/orchestrator.rs
parent1b792a07dd1f48b145ea2fc610f3476dadc774f0 (diff)
Fix: Progress reporting
This patch fixes progress reporting. Because our progress-bar-creating helper initializes the bar with length 1, we have to set the length here manually. The bar has to be added to the multibar object right away, because otherwise it will be rendered to the output which gives us an ugly dead progress bar. If the length is set after the adding to the multibar object, this does not happen. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/orchestrator/orchestrator.rs')
-rw-r--r--src/orchestrator/orchestrator.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index ecd994a..de2f82f 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -233,11 +233,14 @@ impl<'a> Orchestrator<'a> {
let (sender, receiver) = tokio::sync::mpsc::channel(100);
trace!("Creating TaskPreparation object for job {}", uuid);
+ let bar = self.progress_generator.bar();
+ let bar = multibar.add(bar);
+ bar.set_length(100);
let tp = TaskPreparation {
uuid: *uuid,
jobdef,
- bar: multibar.add(self.progress_generator.bar()),
+ bar,
config: self.config,
source_cache: &self.source_cache,
scheduler: &self.scheduler,