set a different worker_type based on what is going to be verified(snapshot, group, ds)

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
Hannes Laimer 2020-10-20 11:10:07 +02:00 committed by Thomas Lamprecht
parent 73df9c515b
commit 133042b5d8
1 changed files with 4 additions and 1 deletions

View File

@ -492,17 +492,20 @@ pub fn verify(
let mut backup_dir = None; let mut backup_dir = None;
let mut backup_group = None; let mut backup_group = None;
let mut worker_type = "verify";
match (backup_type, backup_id, backup_time) { match (backup_type, backup_id, backup_time) {
(Some(backup_type), Some(backup_id), Some(backup_time)) => { (Some(backup_type), Some(backup_id), Some(backup_time)) => {
worker_id = format!("{}_{}_{}_{:08X}", store, backup_type, backup_id, backup_time); worker_id = format!("{}_{}_{}_{:08X}", store, backup_type, backup_id, backup_time);
let dir = BackupDir::new(backup_type, backup_id, backup_time)?; let dir = BackupDir::new(backup_type, backup_id, backup_time)?;
backup_dir = Some(dir); backup_dir = Some(dir);
worker_type = "verify_snapshot";
} }
(Some(backup_type), Some(backup_id), None) => { (Some(backup_type), Some(backup_id), None) => {
worker_id = format!("{}_{}_{}", store, backup_type, backup_id); worker_id = format!("{}_{}_{}", store, backup_type, backup_id);
let group = BackupGroup::new(backup_type, backup_id); let group = BackupGroup::new(backup_type, backup_id);
backup_group = Some(group); backup_group = Some(group);
worker_type = "verify_group";
} }
(None, None, None) => { (None, None, None) => {
worker_id = store.clone(); worker_id = store.clone();
@ -514,7 +517,7 @@ pub fn verify(
let to_stdout = if rpcenv.env_type() == RpcEnvironmentType::CLI { true } else { false }; let to_stdout = if rpcenv.env_type() == RpcEnvironmentType::CLI { true } else { false };
let upid_str = WorkerTask::new_thread( let upid_str = WorkerTask::new_thread(
"verify", worker_type,
Some(worker_id.clone()), Some(worker_id.clone()),
userid, userid,
to_stdout, to_stdout,