mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fixed the problem of empty directory when S3 deleted the directory
This commit is contained in:
parent
85570f27a0
commit
1892677b22
|
@ -183,6 +183,11 @@ func (s3a *S3ApiServer) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *h
|
|||
s3a.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
for _, object := range deleteObjects.Objects {
|
||||
response, _ := s3a.listFilerEntries(bucket, object.ObjectName, 1, "", "/")
|
||||
if len(response.Contents) != 0 && strings.HasSuffix(object.ObjectName, "/") {
|
||||
continue
|
||||
}
|
||||
|
||||
lastSeparator := strings.LastIndex(object.ObjectName, "/")
|
||||
parentDirectoryPath, entryName, isDeleteData, isRecursive := "/", object.ObjectName, true, true
|
||||
if lastSeparator > 0 && lastSeparator+1 < len(object.ObjectName) {
|
||||
|
|
Loading…
Reference in a new issue