Browse Source

no directoriesWithDeletion

pull/1883/head
Konstantin Lebedev 4 years ago
parent
commit
bb3af2d70b
  1. 6
      weed/s3api/s3api_object_handlers.go

6
weed/s3api/s3api_object_handlers.go

@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"encoding/xml" "encoding/xml"
"fmt" "fmt"
"github.com/chrislusf/seaweedfs/weed/filer"
"io" "io"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -15,7 +16,6 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
weed_server "github.com/chrislusf/seaweedfs/weed/server" 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) parentDirectoryPath = fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, parentDirectoryPath)
err := doDeleteEntry(client, parentDirectoryPath, entryName, isDeleteData, isRecursive) err := doDeleteEntry(client, parentDirectoryPath, entryName, isDeleteData, isRecursive)
if err == nil || strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) {
if err == nil {
directoriesWithDeletion[parentDirectoryPath]++ directoriesWithDeletion[parentDirectoryPath]++
deletedObjects = append(deletedObjects, object) deletedObjects = append(deletedObjects, object)
} else if strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) {
deletedObjects = append(deletedObjects, object)
} else { } else {
delete(directoriesWithDeletion, parentDirectoryPath) delete(directoriesWithDeletion, parentDirectoryPath)
deleteErrors = append(deleteErrors, DeleteError{ deleteErrors = append(deleteErrors, DeleteError{

Loading…
Cancel
Save