diff options
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/manager.rs | 15 | ||||
-rw-r--r-- | src/block/repair.rs | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs index 30d6e792..db73ecbc 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -734,12 +734,9 @@ impl Worker for ResyncWorker { ) -> Result<WorkerStatus, Error> { self.tranquilizer.reset(); match self.manager.resync_iter().await { - Ok(ResyncIterResult::BusyDidSomething) => { - self.tranquilizer - .tranquilize(self.manager.background_tranquility) - .await; - Ok(WorkerStatus::Busy) - } + Ok(ResyncIterResult::BusyDidSomething) => Ok(self + .tranquilizer + .tranquilize_worker(self.manager.background_tranquility)), Ok(ResyncIterResult::BusyDidNothing) => Ok(WorkerStatus::Busy), Ok(ResyncIterResult::IdleFor(delay)) => { self.next_delay = delay; @@ -750,10 +747,8 @@ impl Worker for ResyncWorker { // We don't really know how to handle them so just ¯\_(ツ)_/¯ // (there is kind of an assumption that Sled won't error on us, // if it does there is not much we can do -- TODO should we just panic?) - error!( - "Could not do a resync iteration: {} (this is a very bad error)", - e - ); + // Here we just give the error to the worker manager, + // it will print it to the logs and increment a counter Err(e.into()) } } diff --git a/src/block/repair.rs b/src/block/repair.rs index 0445527c..a5c01629 100644 --- a/src/block/repair.rs +++ b/src/block/repair.rs @@ -138,8 +138,7 @@ impl Worker for ScrubWorker { self.tranquilizer.reset(); if let Some(hash) = self.iterator.next().await? { let _ = self.manager.read_block(&hash).await; - self.tranquilizer.tranquilize(self.tranquility).await; - Ok(WorkerStatus::Busy) + Ok(self.tranquilizer.tranquilize_worker(self.tranquility)) } else { Ok(WorkerStatus::Done) } |