mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-25 03:10:24 +08:00
also delete parent folder if empty
fix https://github.com/seaweedfs/seaweedfs/issues/5567
This commit is contained in:
parent
96c48bd0da
commit
1917f70f78
@ -44,7 +44,7 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
directoriesWithDeletion := make(map[string]int)
|
directoriesWithDeletion := make(map[string]int)
|
||||||
lastSeparator := strings.LastIndex(object, "/")
|
lastSeparator := strings.LastIndex(object, "/")
|
||||||
if lastSeparator > 0 {
|
if lastSeparator > 0 {
|
||||||
parentDirectoryPath := fmt.Sprintf("%s/%s", s3a.option.BucketsPath, bucket)
|
parentDirectoryPath := fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object[:lastSeparator])
|
||||||
directoriesWithDeletion[parentDirectoryPath]++
|
directoriesWithDeletion[parentDirectoryPath]++
|
||||||
|
|
||||||
// purge empty folders, only checking folders with deletions
|
// purge empty folders, only checking folders with deletions
|
||||||
|
Loading…
Reference in New Issue
Block a user