mirror of
https://github.com/rclone/rclone
synced 2025-01-06 07:46:25 +01:00
jottacloud: remove DirMove workaround as it's not required anymore - also fixes #4655
This commit is contained in:
parent
8e8ae1edc7
commit
3edc9ff0b0
@ -1087,8 +1087,7 @@ func (f *Fs) copyOrMove(ctx context.Context, method, src, dest string) (info *ap
|
|||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
err = f.pacer.Call(func() (bool, error) {
|
err = f.pacer.Call(func() (bool, error) {
|
||||||
resp, err = f.srv.CallXML(ctx, &opts, nil, &info)
|
resp, err = f.srv.CallXML(ctx, &opts, nil, &info)
|
||||||
retry, _ := shouldRetry(resp, err)
|
return shouldRetry(resp, err)
|
||||||
return (retry && resp.StatusCode != 500), err
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1192,18 +1191,6 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
|
|||||||
|
|
||||||
_, err = f.copyOrMove(ctx, "mvDir", path.Join(f.endpointURL, f.opt.Enc.FromStandardPath(srcPath))+"/", dstRemote)
|
_, err = f.copyOrMove(ctx, "mvDir", path.Join(f.endpointURL, f.opt.Enc.FromStandardPath(srcPath))+"/", dstRemote)
|
||||||
|
|
||||||
// surprise! jottacloud fucked up dirmove - the api spits out an error but
|
|
||||||
// dir gets moved regardless
|
|
||||||
if apiErr, ok := err.(*api.Error); ok {
|
|
||||||
if apiErr.StatusCode == 500 {
|
|
||||||
_, err := f.NewObject(ctx, dstRemote)
|
|
||||||
if err == fs.ErrorNotAFile {
|
|
||||||
log.Printf("FIXME: ignoring DirMove error - move succeeded anyway\n")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "couldn't move directory")
|
return errors.Wrap(err, "couldn't move directory")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user