mirror of
https://github.com/rclone/rclone.git
synced 2024-12-24 16:09:01 +01:00
acd: Fix Move returning nil objects and nil error #1226
This commit is contained in:
parent
c45c604997
commit
488353c977
@ -631,9 +631,11 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
|
|||||||
// Wait for directory caching so we can no longer see the old
|
// Wait for directory caching so we can no longer see the old
|
||||||
// object and see the new object
|
// object and see the new object
|
||||||
time.Sleep(200 * time.Millisecond) // enough time 90% of the time
|
time.Sleep(200 * time.Millisecond) // enough time 90% of the time
|
||||||
var dstObj fs.Object
|
var (
|
||||||
|
dstObj fs.Object
|
||||||
|
srcErr, dstErr error
|
||||||
|
)
|
||||||
for i := 1; i <= fs.Config.LowLevelRetries; i++ {
|
for i := 1; i <= fs.Config.LowLevelRetries; i++ {
|
||||||
var srcErr, dstErr error
|
|
||||||
_, srcErr = srcObj.fs.NewObject(srcObj.remote) // try reading the object
|
_, srcErr = srcObj.fs.NewObject(srcObj.remote) // try reading the object
|
||||||
if srcErr != nil && srcErr != fs.ErrorObjectNotFound {
|
if srcErr != nil && srcErr != fs.ErrorObjectNotFound {
|
||||||
// exit if error on source
|
// exit if error on source
|
||||||
@ -651,7 +653,7 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
|
|||||||
fs.Debugf(src, "Wait for directory listing to update after move %d/%d", i, fs.Config.LowLevelRetries)
|
fs.Debugf(src, "Wait for directory listing to update after move %d/%d", i, fs.Config.LowLevelRetries)
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
}
|
}
|
||||||
return dstObj, nil
|
return dstObj, dstErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// DirCacheFlush resets the directory cache - used in testing as an
|
// DirCacheFlush resets the directory cache - used in testing as an
|
||||||
|
Loading…
Reference in New Issue
Block a user