backup verify: do not check every loop iteration for abort/shutdown
only check every 1024'th, which is cheaper to do than a modulo, as we can just mask the 10 least-significant-bits and check if the result is zero. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
7b2d3a5fe9
commit
2e1b63fb25
|
@ -185,8 +185,10 @@ fn verify_index_chunks(
|
|||
use std::os::unix::fs::MetadataExt;
|
||||
|
||||
for pos in 0..index_count {
|
||||
verify_worker.worker.check_abort()?;
|
||||
crate::tools::fail_on_shutdown()?;
|
||||
if pos & 1023 == 0 {
|
||||
verify_worker.worker.check_abort()?;
|
||||
crate::tools::fail_on_shutdown()?;
|
||||
}
|
||||
|
||||
let info = index.chunk_info(pos).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in New Issue