Keep network status & ring in a tokio::sync::watch

advantages
- reads don't prevent preparing writes
- can be followed from other parts of the system by cloning the receiver
This commit is contained in:
Alex Auvolat
2020-04-11 23:53:32 +02:00
parent 5dd59e437d
commit 9c931f5eda
9 changed files with 165 additions and 133 deletions
+5 -2
View File
@@ -55,8 +55,11 @@ impl TableFormat for BlockRefTable {
}
}
if was_before && !is_after {
if let Err(e) = garage.block_manager.block_decref(&new.block, &garage.background) {
eprintln!("Failed to decref or delete block {:?}: {}", &new.block, e);
if let Err(e) = garage
.block_manager
.block_decref(&new.block, &garage.background)
{
eprintln!("Failed to decref block {:?}: {}", &new.block, e);
}
}
}