Some improvements to Garage internals #451
1 changed files with 8 additions and 7 deletions
|
@ -171,13 +171,14 @@ impl Worker for RepairBlockrefsWorker {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn work(&mut self, _must_exit: &mut watch::Receiver<bool>) -> Result<WorkerState, Error> {
|
async fn work(&mut self, _must_exit: &mut watch::Receiver<bool>) -> Result<WorkerState, Error> {
|
||||||
let (item_bytes, next_pos) = match self.garage.block_ref_table.data.store.get_gt(&self.pos)? {
|
let (item_bytes, next_pos) =
|
||||||
Some((k, v)) => (v, k),
|
match self.garage.block_ref_table.data.store.get_gt(&self.pos)? {
|
||||||
None => {
|
Some((k, v)) => (v, k),
|
||||||
info!("repair_block_ref: finished, done {}", self.counter);
|
None => {
|
||||||
return Ok(WorkerState::Done);
|
info!("repair_block_ref: finished, done {}", self.counter);
|
||||||
}
|
return Ok(WorkerState::Done);
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let block_ref = rmp_serde::decode::from_read_ref::<_, BlockRef>(&item_bytes)?;
|
let block_ref = rmp_serde::decode::from_read_ref::<_, BlockRef>(&item_bytes)?;
|
||||||
if !block_ref.deleted.get() {
|
if !block_ref.deleted.get() {
|
||||||
|
|
Loading…
Reference in a new issue