mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 06:34:54 +08:00
fix(release): 完成分发身份与 CAS legacy ownership 收尾
This commit is contained in:
@@ -389,6 +389,17 @@ impl SqliteRefCounter {
|
||||
transaction.commit().await?;
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
/// Returns whether the durable ledger contains any row for an ownership.
|
||||
pub async fn has_release_ownership(&self, ownership_id: &str) -> Result<bool> {
|
||||
let exists: i64 = sqlx::query_scalar(
|
||||
"SELECT EXISTS(SELECT 1 FROM cas_release_references WHERE release_id = ?1)",
|
||||
)
|
||||
.bind(ownership_id)
|
||||
.fetch_one(&self.pool)
|
||||
.await?;
|
||||
Ok(exists != 0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -176,6 +176,12 @@ impl FileSystemCasRepository {
|
||||
.await
|
||||
}
|
||||
|
||||
/// Returns whether the durable release ownership ledger has any row.
|
||||
pub async fn has_release_ownership(&self, ownership_id: &str) -> Result<bool> {
|
||||
let _lock = self.acquire_operation_lock().await?;
|
||||
self.ref_counter.has_release_ownership(ownership_id).await
|
||||
}
|
||||
|
||||
/// 获取存储统计信息。
|
||||
pub async fn stats(&self) -> Result<StorageStats> {
|
||||
let _lock = self.acquire_operation_lock().await?;
|
||||
|
||||
Reference in New Issue
Block a user