diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-15 20:09:44 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-15 20:09:44 +0100 |
commit | 4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31 (patch) | |
tree | 03da6808b6f0391293ab5a252d5efd1328acdefc /src/garage/repair.rs | |
parent | 667e4e72a8e64a094d57ceeb6442cef08f1ef0e1 (diff) | |
download | garage-4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31.tar.gz garage-4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31.zip |
Refactor block resync loop; make workers infaillible
Diffstat (limited to 'src/garage/repair.rs')
-rw-r--r-- | src/garage/repair.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/garage/repair.rs b/src/garage/repair.rs index 599c1965..4ee66452 100644 --- a/src/garage/repair.rs +++ b/src/garage/repair.rs @@ -20,6 +20,16 @@ impl Repair { &self, opt: RepairOpt, must_exit: watch::Receiver<bool>, + ) { + if let Err(e) = self.repair_worker_aux(opt, must_exit).await { + warn!("Repair worker failed with error: {}", e); + } + } + + async fn repair_worker_aux( + &self, + opt: RepairOpt, + must_exit: watch::Receiver<bool>, ) -> Result<(), Error> { let todo = |x| opt.what.as_ref().map(|y| *y == x).unwrap_or(true); |