From fdd4b4ee220afb8eefffb0bb5e6257b097446a88 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 6 Mar 2016 17:36:05 +0000 Subject: [PATCH] drive: Add missing retries for Move and DirMove --- drive/drive.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drive/drive.go b/drive/drive.go index 731db09fe..5c388adcb 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -772,7 +772,11 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) { } // Do the move - info, err := f.svc.Files.Patch(srcObj.id, dstInfo).SetModifiedDate(true).Do() + var info *drive.File + err = f.pacer.Call(func() (bool, error) { + info, err = f.svc.Files.Patch(srcObj.id, dstInfo).SetModifiedDate(true).Do() + return shouldRetry(err) + }) if err != nil { return nil, err } @@ -814,7 +818,10 @@ func (f *Fs) DirMove(src fs.Fs) error { Title: leaf, Parents: []*drive.ParentReference{{Id: directoryID}}, } - _, err = f.svc.Files.Patch(srcFs.dirCache.RootID(), &patch).Do() + err = f.pacer.Call(func() (bool, error) { + _, err = f.svc.Files.Patch(srcFs.dirCache.RootID(), &patch).Do() + return shouldRetry(err) + }) if err != nil { return err }