aboutsummaryrefslogtreecommitdiffstats
path: root/drive
diff options
context:
space:
mode:
Diffstat (limited to 'drive')
-rw-r--r--drive/sync_download.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/drive/sync_download.go b/drive/sync_download.go
index 10a8d18..20ff87d 100644
--- a/drive/sync_download.go
+++ b/drive/sync_download.go
@@ -209,12 +209,14 @@ func (self *Drive) downloadRemoteFile(id, fpath string, args DownloadSyncArgs, t
// Save file to disk
_, err = io.Copy(outFile, srcReader)
- if err != nil && try < MaxBackendErrorRetries {
- exponentialBackoffSleep(try)
- try++
- self.downloadRemoteFile(id, fpath, args, try)
- } else {
- return fmt.Errorf("Download was interrupted: %s", err)
+ if err != nil {
+ if try < MaxBackendErrorRetries {
+ exponentialBackoffSleep(try)
+ try++
+ self.downloadRemoteFile(id, fpath, args, try)
+ } else {
+ return fmt.Errorf("Download was interrupted: %s", err)
+ }
}
return nil