diff options
| author | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-03-10 19:52:41 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <lebedev_k@tochka.com> | 2021-03-10 19:52:41 +0500 |
| commit | bb3af2d70b73a02e79e47ba13ba6178d7fe3b562 (patch) | |
| tree | 9d188281ee45753c4f84fdfe26663dd7c46c230e | |
| parent | 15b018da3443be3c828c28917531e008db955ce5 (diff) | |
| download | seaweedfs-bb3af2d70b73a02e79e47ba13ba6178d7fe3b562.tar.xz seaweedfs-bb3af2d70b73a02e79e47ba13ba6178d7fe3b562.zip | |
no directoriesWithDeletion
| -rw-r--r-- | weed/s3api/s3api_object_handlers.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 4bdc96d38..03b8b3628 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -5,6 +5,7 @@ import ( "encoding/json" "encoding/xml" "fmt" + "github.com/chrislusf/seaweedfs/weed/filer" "io" "io/ioutil" "net/http" @@ -15,7 +16,6 @@ import ( "github.com/gorilla/mux" - "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" weed_server "github.com/chrislusf/seaweedfs/weed/server" @@ -194,9 +194,11 @@ func (s3a *S3ApiServer) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *h parentDirectoryPath = fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, parentDirectoryPath) err := doDeleteEntry(client, parentDirectoryPath, entryName, isDeleteData, isRecursive) - if err == nil || strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) { + if err == nil { directoriesWithDeletion[parentDirectoryPath]++ deletedObjects = append(deletedObjects, object) + } else if strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) { + deletedObjects = append(deletedObjects, object) } else { delete(directoriesWithDeletion, parentDirectoryPath) deleteErrors = append(deleteErrors, DeleteError{ |
