worker task: fix passing upid to send command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-04 16:44:07 +01:00
parent be99df2767
commit 385681c9ab
1 changed files with 6 additions and 2 deletions

View File

@ -55,7 +55,9 @@ pub async fn worker_is_active(upid: &UPID) -> Result<bool, Error> {
let sock = server::ctrl_sock_from_pid(upid.pid); let sock = server::ctrl_sock_from_pid(upid.pid);
let cmd = json!({ let cmd = json!({
"command": "worker-task-status", "command": "worker-task-status",
"args": {
"upid": upid.to_string(), "upid": upid.to_string(),
},
}); });
let status = super::send_command(sock, cmd).await?; let status = super::send_command(sock, cmd).await?;
@ -127,7 +129,9 @@ pub async fn abort_worker(upid: UPID) -> Result<(), Error> {
let sock = server::ctrl_sock_from_pid(upid.pid); let sock = server::ctrl_sock_from_pid(upid.pid);
let cmd = json!({ let cmd = json!({
"command": "worker-task-abort", "command": "worker-task-abort",
"args": {
"upid": upid.to_string(), "upid": upid.to_string(),
},
}); });
super::send_command(sock, cmd).map_ok(|_| ()).await super::send_command(sock, cmd).map_ok(|_| ()).await
} }