mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
Fix data usage cache and scanner (#2074)
This commit is contained in:
@@ -1109,10 +1109,13 @@ impl DataUsageCache {
|
||||
let mut buf = Vec::new();
|
||||
self.serialize(&mut rmp_serde::Serializer::new(&mut buf))?;
|
||||
|
||||
let path = path_join_buf(&[BUCKET_META_PREFIX, name]);
|
||||
|
||||
let store_clone = store.clone();
|
||||
let buf_clone = buf.clone();
|
||||
let path_clone = path.clone();
|
||||
let res = timeout(Duration::from_secs(5), async move {
|
||||
save_config(store_clone, name, buf_clone).await?;
|
||||
save_config(store_clone, &path_clone, buf_clone).await?;
|
||||
Ok::<(), StorageError>(())
|
||||
})
|
||||
.await
|
||||
@@ -1125,8 +1128,9 @@ impl DataUsageCache {
|
||||
|
||||
let store_clone = store.clone();
|
||||
let backup_name = format!("{name}.bkp");
|
||||
let backup_path = path_join_buf(&[BUCKET_META_PREFIX, &backup_name]);
|
||||
let res = timeout(Duration::from_secs(5), async move {
|
||||
save_config(store_clone, backup_name.as_str(), buf).await?;
|
||||
save_config(store_clone, &backup_path, buf).await?;
|
||||
Ok::<(), StorageError>(())
|
||||
})
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user