aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-15 20:09:44 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-15 20:09:44 +0100
commit4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31 (patch)
tree03da6808b6f0391293ab5a252d5efd1328acdefc /src/garage
parent667e4e72a8e64a094d57ceeb6442cef08f1ef0e1 (diff)
downloadgarage-4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31.tar.gz
garage-4d4117f2b4eb69b63e2329f6e0b8929e6a8b5b31.zip
Refactor block resync loop; make workers infaillible
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/repair.rs10
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);