From cff702a951cb5bb193c7a891ababfd1d962ae9ed Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 22 Feb 2024 12:28:21 +0100 Subject: [lock-createbucket] Add node-global lock for bucket/key operations (fix #723) --- src/model/migrate.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/model/migrate.rs') diff --git a/src/model/migrate.rs b/src/model/migrate.rs index 4c74b43b..8528382a 100644 --- a/src/model/migrate.rs +++ b/src/model/migrate.rs @@ -67,6 +67,8 @@ impl Migrate { None }; + let helper = self.garage.locked_helper().await; + self.garage .bucket_table .insert(&Bucket { @@ -84,14 +86,10 @@ impl Migrate { }) .await?; - self.garage - .bucket_helper() - .set_global_bucket_alias(bucket_id, &new_name) - .await?; + helper.set_global_bucket_alias(bucket_id, &new_name).await?; for (k, ts, perm) in old_bucket_p.authorized_keys.items().iter() { - self.garage - .bucket_helper() + helper .set_bucket_key_permissions( bucket_id, k, -- cgit v1.2.3