mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 09:25:46 +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.
|
||||
pub fn delete_group(
|
||||
pub async fn delete_group(
|
||||
store: String,
|
||||
ns: Option<BackupNamespace>,
|
||||
group: pbs_api_types::BackupGroup,
|
||||
_info: &ApiMethod,
|
||||
rpcenv: &mut dyn RpcEnvironment,
|
||||
) -> Result<Value, Error> {
|
||||
let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
|
||||
|
||||
tokio::task::spawn_blocking(move || {
|
||||
let ns = ns.unwrap_or_default();
|
||||
|
||||
let datastore = check_privs_and_load_store(
|
||||
@ -298,6 +299,8 @@ pub fn delete_group(
|
||||
}
|
||||
|
||||
Ok(Value::Null)
|
||||
})
|
||||
.await?
|
||||
}
|
||||
|
||||
#[api(
|
||||
|
Loading…
Reference in New Issue
Block a user