mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
hdfs: retry the create too FIXME
This commit is contained in:
parent
656ef8952f
commit
1bdeabfa46
@ -128,12 +128,6 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
}
|
||||
|
||||
out, err := o.fs.client.Create(realpath)
|
||||
if err != nil {
|
||||
fs.Errorf(o, "update: Create(%q) returned error: %v", realpath, err)
|
||||
return err
|
||||
}
|
||||
|
||||
cleanup := func() {
|
||||
rerr := o.fs.client.Remove(realpath)
|
||||
if rerr != nil {
|
||||
@ -142,7 +136,19 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
}
|
||||
|
||||
var out *hdfs.FileWriter
|
||||
err = o.fs.pacer.Call(func() (bool, error) {
|
||||
if out != nil {
|
||||
_ = out.Close()
|
||||
out = nil
|
||||
}
|
||||
|
||||
out, err = o.fs.client.Create(realpath)
|
||||
if err != nil {
|
||||
fs.Errorf(o, "update: Create(%q) returned error: %v", realpath, err)
|
||||
return false, err
|
||||
}
|
||||
|
||||
_, err = io.Copy(out, in)
|
||||
if err == nil {
|
||||
return false, nil
|
||||
|
Loading…
Reference in New Issue
Block a user