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