Make block resync speed dynamically configurable #369

Merged
lx merged 5 commits from resync-ajustable-speed into main 2022-09-05 10:35:09 +00:00
Showing only changes of commit e1751c8a9c - Show all commits

View file

@ -311,7 +311,7 @@ impl BlockResyncManager {
}));
}
}
return Ok(None);
Ok(None)
}
async fn resync_block(&self, manager: &BlockManager, hash: &Hash) -> Result<(), Error> {
@ -432,7 +432,7 @@ impl BlockResyncManager {
}
pub async fn set_n_workers(&self, n_workers: usize) -> Result<(), Error> {
if n_workers < 1 || n_workers > MAX_RESYNC_WORKERS {
if !(1..=MAX_RESYNC_WORKERS).contains(&n_workers) {
return Err(Error::Message(format!(
"Invalid number of resync workers, must be between 1 and {}",
MAX_RESYNC_WORKERS