From 0dba7b8a46a1e96732e1300979cdc9581f1ad756 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 23 Jun 2020 16:41:46 +0100 Subject: [PATCH] swift: speed up deletes by not retrying segment container deletes Before this fix rclone would continually try to delete non empty segment containers which made deleting lots of files very slow. This fix makes rclone just try the delete once and then carry on which was the original intent of the code before the retry logic got put in. --- backend/swift/swift.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/swift/swift.go b/backend/swift/swift.go index c86532281..394f40d1e 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -1124,6 +1124,9 @@ func (o *Object) removeSegments(except string) error { // remove the segments container if empty, ignore errors err = o.fs.pacer.Call(func() (bool, error) { err = o.fs.c.ContainerDelete(segmentsContainer) + if err == swift.ContainerNotFound || err == swift.ContainerNotEmpty { + return false, err + } return shouldRetry(err) }) if err == nil {