api: make some workers log on CLI

some workers did not log when called via cli

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-09-21 12:11:16 +02:00
committed by Thomas Lamprecht
parent f54634a890
commit bfa942c0cf
8 changed files with 25 additions and 14 deletions

View File

@ -952,11 +952,13 @@ pub fn prune_datastore(
let datastore = DataStore::lookup_datastore(&store)?;
let to_stdout = rpcenv.env_type() == RpcEnvironmentType::CLI;
let upid_str = WorkerTask::new_thread(
"prune",
Some(store.clone()),
auth_id.clone(),
false,
to_stdout,
move |worker| crate::server::prune_datastore(
worker.clone(),
auth_id,