fix:delete_bucket skip when volume not empty

This commit is contained in:
weisd
2024-09-13 14:15:09 +08:00
parent 2dd46203ee
commit 210d7a4d59
3 changed files with 17 additions and 13 deletions
+6 -2
View File
@@ -3,7 +3,7 @@ use ecstore::{
erasure::{ReadAt, Write},
peer::{LocalPeerS3Client, PeerS3Client},
store::{all_local_disk_path, find_local_disk},
store_api::{BucketOptions, FileInfo, MakeBucketOptions},
store_api::{BucketOptions, DeleteBucketOptions, FileInfo, MakeBucketOptions},
};
use tonic::{Request, Response, Status};
use tracing::{debug, error, info};
@@ -188,7 +188,11 @@ impl Node for NodeService {
debug!("make bucket");
let request = request.into_inner();
match self.local_peer.delete_bucket(&request.bucket).await {
match self
.local_peer
.delete_bucket(&request.bucket, &DeleteBucketOptions { force: false })
.await
{
Ok(_) => Ok(tonic::Response::new(DeleteBucketResponse {
success: true,
error_info: None,