Fix data usage cache and scanner (#2074)

This commit is contained in:
weisd
2026-03-04 19:55:01 +08:00
committed by GitHub
parent 05032cf887
commit ed18b3da75
4 changed files with 31 additions and 93 deletions
+6 -2
View File
@@ -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