diff --git a/src/lib.rs b/src/lib.rs index 515c700..6bf878e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -418,43 +418,40 @@ impl BenchmarkRepository active_job_ids.insert(job_id); } - loop + while !active_job_ids.is_empty() { - while !active_job_ids.is_empty() - { - active_job_ids.retain - ( - |job_id| + active_job_ids.retain + ( + |job_id| + { + let job_repository_path = self.result_repository_path(*job_id); + let job_repository = match Repository::open(&job_repository_path) { - let job_repository_path = self.result_repository_path(*job_id); - let job_repository = match Repository::open(&job_repository_path) - { - Ok(value) => value, - Err(error) => panic!("cannot access result repository for job {}: {}", job_id, error), - }; + Ok(value) => value, + Err(error) => panic!("cannot access result repository for job {}: {}", job_id, error), + }; - let job_commit = match Self::tip_commit(&job_repository, false, "master") - { - Ok(value) => value, - // Job is not done yet, so skip it until it is - Err(_) => return true, - }; + let job_commit = match Self::tip_commit(&job_repository, false, "master") + { + Ok(value) => value, + // Job is not done yet, so skip it until it is + Err(_) => return true, + }; - info!("job {} finished", job_id); + info!("job {} finished", job_id); - let remote_commit = match Self::tip_commit(&self.repository, true, "results") - { - Ok(value) => value, - Err(error) => panic!("could not access tip commit of “results” branch: {}", error), - }; + let remote_commit = match Self::tip_commit(&self.repository, true, "results") + { + Ok(value) => value, + Err(error) => panic!("could not access tip commit of “results” branch: {}", error), + }; - false - } - ); + false + } + ); - println!("================"); - std::thread::sleep(std::time::Duration::from_secs(2)); - } + println!("================"); + std::thread::sleep(std::time::Duration::from_secs(2)); } } }