diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-08 13:25:01 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-12-08 13:29:26 +0100 |
commit | 4a438161d51caab341f621128d84297d2c9fc762 (patch) | |
tree | 66ab89100481a90b77dbef9480d1d133a5b3209c /src/orchestrator/orchestrator.rs | |
parent | 4df090b2bd3887c384af55a05be2c4b8d25ffb6c (diff) |
Simplify: Pass ref to MergedStores object
This reduces the runtime because the MergedStores object does not have
to be created all the time, also, less parameters are passed to the
run_jobset() function.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/orchestrator/orchestrator.rs')
-rw-r--r-- | src/orchestrator/orchestrator.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 40d6797..aea6a96 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -70,11 +70,11 @@ impl<'a> Orchestrator<'a> { pub async fn run(self) -> Result<Vec<Artifact>> { let mut report_result = vec![]; let scheduler = self.scheduler; // moved here because of partial-move semantics + let merged_store = MergedStores::new(self.release_store.clone(), self.staging_store.clone()); for jobset in self.jobsets.into_iter() { let mut results = Self::run_jobset(&scheduler, - self.release_store.clone(), - self.staging_store.clone(), + &merged_store, &self.source_cache, &self.config, jobset) @@ -88,8 +88,7 @@ impl<'a> Orchestrator<'a> { async fn run_jobset( scheduler: &EndpointScheduler, - release_store: Arc<RwLock<ReleaseStore>>, - staging_store: Arc<RwLock<StagingStore>>, + merged_store: &MergedStores, source_cache: &SourceCache, config: &Configuration, jobset: JobSet) @@ -97,7 +96,6 @@ impl<'a> Orchestrator<'a> { { use tokio::stream::StreamExt; - let merged_store = MergedStores::new(release_store, staging_store); let multibar = Arc::new(indicatif::MultiProgress::new()); let results = jobset // run the jobs in the set .into_runables(&merged_store, source_cache, config) |