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.
This commit is contained in:
Nick Craig-Wood 2020-06-23 16:41:46 +01:00
parent e247811db5
commit 0dba7b8a46

View file

@ -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 {