aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/key.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-22 12:28:21 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-22 12:28:21 +0100
commitcff702a951cb5bb193c7a891ababfd1d962ae9ed (patch)
treef7747f950672246c1ecc079e50222a07d23bc635 /src/api/admin/key.rs
parent7e212e20e02b9cdced52ce23111214c6285a095a (diff)
downloadgarage-cff702a951cb5bb193c7a891ababfd1d962ae9ed.tar.gz
garage-cff702a951cb5bb193c7a891ababfd1d962ae9ed.zip
[lock-createbucket] Add node-global lock for bucket/key operations (fix #723)lock-createbucket
Diffstat (limited to 'src/api/admin/key.rs')
-rw-r--r--src/api/admin/key.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/admin/key.rs b/src/api/admin/key.rs
index 1efaca16..291b6d54 100644
--- a/src/api/admin/key.rs
+++ b/src/api/admin/key.rs
@@ -151,11 +151,11 @@ pub async fn handle_delete_key(
garage: &Arc<Garage>,
id: String,
) -> Result<Response<ResBody>, Error> {
- let mut key = garage.key_helper().get_existing_key(&id).await?;
+ let helper = garage.locked_helper().await;
- key.state.as_option().unwrap();
+ let mut key = helper.key().get_existing_key(&id).await?;
- garage.key_helper().delete_key(&mut key).await?;
+ helper.delete_key(&mut key).await?;
Ok(Response::builder()
.status(StatusCode::NO_CONTENT)