aboutsummaryrefslogtreecommitdiff
path: root/src/garage/repair
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-08 10:39:41 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-08 10:39:41 +0200
commitd1cf1a0fa6952e84874f36f1dc66e4a978959d8f (patch)
treef65135f725b9f22ac2eac54e5023ab6a548549ec /src/garage/repair
parent0f660b086c23d13c91b0c55fd4d43017a09c1f4b (diff)
downloadgarage-d1cf1a0fa6952e84874f36f1dc66e4a978959d8f.tar.gz
garage-d1cf1a0fa6952e84874f36f1dc66e4a978959d8f.zip
Rename WorkerStatus to WorkerState
because it's a state in a state machine
Diffstat (limited to 'src/garage/repair')
-rw-r--r--src/garage/repair/online.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/garage/repair/online.rs b/src/garage/repair/online.rs
index eeb9cea3..160ce8f8 100644
--- a/src/garage/repair/online.rs
+++ b/src/garage/repair/online.rs
@@ -92,7 +92,7 @@ impl Worker for RepairVersionsWorker {
async fn work(
&mut self,
_must_exit: &mut watch::Receiver<bool>,
- ) -> Result<WorkerStatus, Error> {
+ ) -> Result<WorkerState, Error> {
let item_bytes = match self.garage.version_table.data.store.get_gt(&self.pos)? {
Some((k, v)) => {
self.pos = k;
@@ -100,7 +100,7 @@ impl Worker for RepairVersionsWorker {
}
None => {
info!("repair_versions: finished, done {}", self.counter);
- return Ok(WorkerStatus::Done);
+ return Ok(WorkerState::Done);
}
};
@@ -134,10 +134,10 @@ impl Worker for RepairVersionsWorker {
}
}
- Ok(WorkerStatus::Busy)
+ Ok(WorkerState::Busy)
}
- async fn wait_for_work(&mut self, _must_exit: &watch::Receiver<bool>) -> WorkerStatus {
+ async fn wait_for_work(&mut self, _must_exit: &watch::Receiver<bool>) -> WorkerState {
unreachable!()
}
}
@@ -173,7 +173,7 @@ impl Worker for RepairBlockrefsWorker {
async fn work(
&mut self,
_must_exit: &mut watch::Receiver<bool>,
- ) -> Result<WorkerStatus, Error> {
+ ) -> Result<WorkerState, Error> {
let item_bytes = match self.garage.block_ref_table.data.store.get_gt(&self.pos)? {
Some((k, v)) => {
self.pos = k;
@@ -181,7 +181,7 @@ impl Worker for RepairBlockrefsWorker {
}
None => {
info!("repair_block_ref: finished, done {}", self.counter);
- return Ok(WorkerStatus::Done);
+ return Ok(WorkerState::Done);
}
};
@@ -212,10 +212,10 @@ impl Worker for RepairBlockrefsWorker {
}
}
- Ok(WorkerStatus::Busy)
+ Ok(WorkerState::Busy)
}
- async fn wait_for_work(&mut self, _must_exit: &watch::Receiver<bool>) -> WorkerStatus {
+ async fn wait_for_work(&mut self, _must_exit: &watch::Receiver<bool>) -> WorkerState {
unreachable!()
}
}