aboutsummaryrefslogtreecommitdiffstats
path: root/drive/sync_download.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-04-09 18:54:10 +0200
committerPetter Rasmussen2016-04-09 18:54:10 +0200
commitbdd7877be9c503e7968c221f3396d239edb267d2 (patch)
tree63f05b7d803573228317ba0290880ad930c4fdf8 /drive/sync_download.go
parent17b8c6511f776bb37ce31f8f64f7cc2f1a3640fb (diff)
downloadgdrive-bdd7877be9c503e7968c221f3396d239edb267d2.tar.bz2
Check both backend and rate limit errors
Diffstat (limited to 'drive/sync_download.go')
-rw-r--r--drive/sync_download.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/drive/sync_download.go b/drive/sync_download.go
index 10dfd16..58cd49c 100644
--- a/drive/sync_download.go
+++ b/drive/sync_download.go
@@ -193,7 +193,7 @@ func (self *Drive) downloadRemoteFile(id, fpath string, args DownloadSyncArgs, t
res, err := self.service.Files.Get(id).Context(ctx).Download()
if err != nil {
- if isBackendError(err) && try < MaxBackendErrorRetries {
+ if isBackendOrRateLimitError(err) && try < MaxErrorRetries {
exponentialBackoffSleep(try)
try++
return self.downloadRemoteFile(id, fpath, args, try)
@@ -231,7 +231,7 @@ func (self *Drive) downloadRemoteFile(id, fpath string, args DownloadSyncArgs, t
_, err = io.Copy(outFile, reader)
if err != nil {
outFile.Close()
- if try < MaxBackendErrorRetries {
+ if try < MaxErrorRetries {
exponentialBackoffSleep(try)
try++
return self.downloadRemoteFile(id, fpath, args, try)