fix(release): 修复发布一致性与并发边界
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-12 16:35:55 +08:00
parent 8d57a63697
commit 30d1cd77e8
20 changed files with 1100 additions and 102 deletions
+15
View File
@@ -30,6 +30,21 @@ impl FileSystemCasRepository {
self.engine().await.map(|_| ())
}
/// Releases one release-owned CAS reference exactly once.
pub async fn release_reference_once(
&self,
release_id: &str,
ordinal: u64,
id: &ObjectId,
) -> bat_core::Result<bool> {
let hash = Self::parse_object_id(id)?;
self.engine()
.await?
.release_reference_once(release_id, ordinal, &hash)
.await
.map_err(Self::map_error)
}
async fn engine(&self) -> bat_core::Result<&engine_repository::FileSystemCasRepository> {
self.inner
.get_or_try_init(|| async {