diff --git a/Cargo.lock b/Cargo.lock index c45ee015..e1ccfc2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1737,7 +1737,7 @@ dependencies = [ [[package]] name = "k2v-client" -version = "0.1.0" +version = "0.0.1" dependencies = [ "base64", "clap 3.1.18", diff --git a/src/block/manager.rs b/src/block/manager.rs index e54fb992..017ba9da 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -773,10 +773,7 @@ impl Worker for ResyncWorker { } } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { self.tranquilizer.reset(); match self.manager.resync_iter().await { Ok(ResyncIterResult::BusyDidSomething) => Ok(self diff --git a/src/block/repair.rs b/src/block/repair.rs index cd5afe44..07ff6772 100644 --- a/src/block/repair.rs +++ b/src/block/repair.rs @@ -62,10 +62,7 @@ impl Worker for RepairWorker { } } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { match self.block_iter.as_mut() { None => { // Phase 1: Repair blocks from RC table. @@ -279,10 +276,7 @@ impl Worker for ScrubWorker { )) } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { match self.rx_cmd.try_recv() { Ok(cmd) => self.handle_cmd(cmd).await, Err(mpsc::error::TryRecvError::Disconnected) => return Ok(WorkerState::Done), diff --git a/src/garage/repair/online.rs b/src/garage/repair/online.rs index 160ce8f8..e33cf097 100644 --- a/src/garage/repair/online.rs +++ b/src/garage/repair/online.rs @@ -89,10 +89,7 @@ impl Worker for RepairVersionsWorker { Some(format!("{} items done", self.counter)) } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { let item_bytes = match self.garage.version_table.data.store.get_gt(&self.pos)? { Some((k, v)) => { self.pos = k; @@ -170,10 +167,7 @@ impl Worker for RepairBlockrefsWorker { Some(format!("{} items done", self.counter)) } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { let item_bytes = match self.garage.block_ref_table.data.store.get_gt(&self.pos)? { Some((k, v)) => { self.pos = k; diff --git a/src/table/gc.rs b/src/table/gc.rs index 9ffae184..12218d97 100644 --- a/src/table/gc.rs +++ b/src/table/gc.rs @@ -344,10 +344,7 @@ where } } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { match self.gc.gc_loop_iter().await? { None => Ok(WorkerState::Busy), Some(delay) => { diff --git a/src/table/merkle.rs b/src/table/merkle.rs index ca5891a7..a5c29723 100644 --- a/src/table/merkle.rs +++ b/src/table/merkle.rs @@ -322,10 +322,7 @@ where } } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { let updater = self.0.clone(); tokio::task::spawn_blocking(move || { for _i in 0..100 { diff --git a/src/util/background/job_worker.rs b/src/util/background/job_worker.rs index 6754382a..2568ea11 100644 --- a/src/util/background/job_worker.rs +++ b/src/util/background/job_worker.rs @@ -21,10 +21,7 @@ impl Worker for JobWorker { format!("Job worker #{}", self.index) } - async fn work( - &mut self, - _must_exit: &mut watch::Receiver, - ) -> Result { + async fn work(&mut self, _must_exit: &mut watch::Receiver) -> Result { match self.next_job.take() { None => return Ok(WorkerState::Idle), Some(job) => {