WorkerTaskContext: add shutdown_requested() and fail_on_shutdown()

This commit is contained in:
Dietmar Maurer
2021-09-24 11:56:53 +02:00
parent 619cd5cbcb
commit 0fd55b08d9
6 changed files with 37 additions and 11 deletions

View File

@ -172,7 +172,7 @@ fn verify_index_chunks(
let check_abort = |pos: usize| -> Result<(), Error> {
if pos & 1023 == 0 {
verify_worker.worker.check_abort()?;
proxmox_rest_server::fail_on_shutdown()?;
verify_worker.worker.fail_on_shutdown()?;
}
Ok(())
};
@ -184,7 +184,7 @@ fn verify_index_chunks(
for (pos, _) in chunk_list {
verify_worker.worker.check_abort()?;
proxmox_rest_server::fail_on_shutdown()?;
verify_worker.worker.fail_on_shutdown()?;
let info = index.chunk_info(pos).unwrap();
@ -376,7 +376,7 @@ pub fn verify_backup_dir_with_lock(
});
verify_worker.worker.check_abort()?;
proxmox_rest_server::fail_on_shutdown()?;
verify_worker.worker.fail_on_shutdown()?;
if let Err(err) = result {
task_log!(