swift: ignore 404 error when deleting an object

See: https://forum.rclone.org/t/rclone-should-optionally-ignore-404-for-delete/37592
This commit is contained in:
Nick Craig-Wood 2023-04-14 16:30:35 +01:00
parent 5836da14c2
commit db8c007983

View file

@ -1558,6 +1558,10 @@ func (o *Object) Remove(ctx context.Context) (err error) {
// Remove file/manifest first
err = o.fs.pacer.Call(func() (bool, error) {
err = o.fs.c.ObjectDelete(ctx, container, containerPath)
if err == swift.ObjectNotFound {
fs.Errorf(o, "Dangling object - ignoring: %v", err)
err = nil
}
return shouldRetry(ctx, err)
})
if err != nil {