mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
pcloud: try harder to delete a failed upload
This fixes the integration tests when testing errored uploads
This commit is contained in:
parent
9c2533821d
commit
badefdb060
@ -1165,10 +1165,14 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
|||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// sometimes pcloud leaves a half complete file on
|
// sometimes pcloud leaves a half complete file on
|
||||||
// error, so delete it if it exists
|
// error, so delete it if it exists, trying a few times
|
||||||
delObj, delErr := o.fs.NewObject(ctx, o.remote)
|
for i := 0; i < 5; i++ {
|
||||||
if delErr == nil && delObj != nil {
|
delObj, delErr := o.fs.NewObject(ctx, o.remote)
|
||||||
_ = delObj.Remove(ctx)
|
if delErr == nil && delObj != nil {
|
||||||
|
_ = delObj.Remove(ctx)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user