mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-07 04:27:49 +01:00
simplify
This commit is contained in:
1 parent
f618121e63
commit
b8121e4b24
1 file changed
+2
-5
@@ -43,11 +43,8 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
|
||||
}
|
||||
|
||||
directoriesWithDeletion := make(map[string]int)
|
||||
lastSeparator := strings.LastIndex(object, "/")
|
||||
if lastSeparator > 0 {
|
||||
parentDirectoryPath := fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object[:lastSeparator])
|
||||
directoriesWithDeletion[parentDirectoryPath]++
|
||||
|
||||
if strings.LastIndex(object, "/") > 0 {
|
||||
directoriesWithDeletion[dir]++
|
||||
// purge empty folders, only checking folders with deletions
|
||||
for len(directoriesWithDeletion) > 0 {
|
||||
directoriesWithDeletion = s3a.doDeleteEmptyDirectories(client, directoriesWithDeletion)
|
||||
|
||||
Reference in new issue
Block a user