webdav: Attempt to remove failed uploads
Some webdav backends (eg rclone serve webdav) leave behind half written files on error. This causes the integration tests to fail. Here we remove the file if it exists.
This commit is contained in:
parent
58339a5cb6
commit
eb84b58d3c
1 changed files with 2 additions and 0 deletions
|
@ -968,6 +968,8 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOptio
|
|||
return shouldRetry(resp, err)
|
||||
})
|
||||
if err != nil {
|
||||
// Remove failed upload
|
||||
_ = o.Remove()
|
||||
return err
|
||||
}
|
||||
// read metadata from remote
|
||||
|
|
Loading…
Reference in a new issue