refactor: format syntaxt
This commit is contained in:
@@ -355,14 +355,13 @@ impl DriveRepository for DrivePgRepository {
|
||||
.await
|
||||
.map_err(|e| Self::map_sqlx_err("delete_atomic.grants", e))?;
|
||||
|
||||
let root: (Uuid,) = sqlx::query_as(
|
||||
"SELECT root_folder_id FROM storage.drives WHERE id = $1",
|
||||
)
|
||||
.bind(drive_id)
|
||||
.fetch_optional(&mut *tx)
|
||||
.await
|
||||
.map_err(|e| Self::map_sqlx_err("delete_atomic.lookup_root", e))?
|
||||
.ok_or_else(|| DriveRepositoryError::NotFound(drive_id.to_string()))?;
|
||||
let root: (Uuid,) =
|
||||
sqlx::query_as("SELECT root_folder_id FROM storage.drives WHERE id = $1")
|
||||
.bind(drive_id)
|
||||
.fetch_optional(&mut *tx)
|
||||
.await
|
||||
.map_err(|e| Self::map_sqlx_err("delete_atomic.lookup_root", e))?
|
||||
.ok_or_else(|| DriveRepositoryError::NotFound(drive_id.to_string()))?;
|
||||
|
||||
sqlx::query("DELETE FROM storage.drives WHERE id = $1")
|
||||
.bind(drive_id)
|
||||
|
||||
@@ -1912,10 +1912,7 @@ impl DedupService {
|
||||
self.garbage_collect_with_grace(0).await
|
||||
}
|
||||
|
||||
async fn garbage_collect_with_grace(
|
||||
&self,
|
||||
grace_secs: i64,
|
||||
) -> Result<(u64, u64), DomainError> {
|
||||
async fn garbage_collect_with_grace(&self, grace_secs: i64) -> Result<(u64, u64), DomainError> {
|
||||
const BATCH_SIZE: i64 = 500;
|
||||
|
||||
let mut total_deleted = 0u64;
|
||||
|
||||
Reference in New Issue
Block a user