diff options
author | Alex <alex@adnab.me> | 2024-02-22 12:05:19 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-02-22 12:05:19 +0000 |
commit | 74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6 (patch) | |
tree | f7747f950672246c1ecc079e50222a07d23bc635 /src/api/admin/key.rs | |
parent | 7e212e20e02b9cdced52ce23111214c6285a095a (diff) | |
parent | cff702a951cb5bb193c7a891ababfd1d962ae9ed (diff) | |
download | garage-74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6.tar.gz garage-74d0c47f21ae2f9998a7dcbca3a27e3cc51e70b6.zip |
Merge pull request 'Add node-global lock for bucket/key operations (fix #723)' (#728) from lock-createbucket into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/728
Diffstat (limited to 'src/api/admin/key.rs')
-rw-r--r-- | src/api/admin/key.rs | 6 |
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) |