tape: also abort backup/restore on server shutdown

This commit is contained in:
Dietmar Maurer
2021-03-02 07:19:31 +01:00
parent d64226efee
commit 9bd81bb384
3 changed files with 10 additions and 0 deletions

View File

@ -386,6 +386,7 @@ pub fn request_and_load_media(
loop {
worker.check_abort()?;
crate::tools::fail_on_shutdown()?;
let mut handle = match drive_config.open() {
Ok(handle) => handle,
@ -397,6 +398,7 @@ pub fn request_and_load_media(
}
for _ in 0..50 { // delay 5 seconds
worker.check_abort()?;
crate::tools::fail_on_shutdown()?;
std::thread::sleep(std::time::Duration::from_millis(100));
}
continue;
@ -441,6 +443,7 @@ pub fn request_and_load_media(
// eprintln!("read label failed - test again in 5 secs");
for _ in 0..50 { // delay 5 seconds
worker.check_abort()?;
crate::tools::fail_on_shutdown()?;
std::thread::sleep(std::time::Duration::from_millis(100));
}
}