mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-16 05:27:37 +00:00
api: wrap delete_group in spawn_blocking
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
a577d7d801
commit
6f67dc1197
@ -273,14 +273,15 @@ pub fn list_groups(
|
|||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Delete backup group including all snapshots.
|
/// Delete backup group including all snapshots.
|
||||||
pub fn delete_group(
|
pub async fn delete_group(
|
||||||
store: String,
|
store: String,
|
||||||
ns: Option<BackupNamespace>,
|
ns: Option<BackupNamespace>,
|
||||||
group: pbs_api_types::BackupGroup,
|
group: pbs_api_types::BackupGroup,
|
||||||
_info: &ApiMethod,
|
|
||||||
rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<Value, Error> {
|
) -> Result<Value, Error> {
|
||||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||||
|
|
||||||
|
tokio::task::spawn_blocking(move || {
|
||||||
let ns = ns.unwrap_or_default();
|
let ns = ns.unwrap_or_default();
|
||||||
|
|
||||||
let datastore = check_privs_and_load_store(
|
let datastore = check_privs_and_load_store(
|
||||||
@ -298,6 +299,8 @@ pub fn delete_group(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ok(Value::Null)
|
Ok(Value::Null)
|
||||||
|
})
|
||||||
|
.await?
|
||||||
}
|
}
|
||||||
|
|
||||||
#[api(
|
#[api(
|
||||||
|
Loading…
Reference in New Issue
Block a user