aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Rasmussen2016-02-08 22:51:01 +0100
committerPetter Rasmussen2016-02-08 22:51:01 +0100
commit48221145e64d65fb7afc1dba40e6f41bb7b76e7d (patch)
tree1219e51656875cee6492f97c9b5cb243ebaa0e2d
parent9e2fbc9471996cdab057c2d3807a847424653036 (diff)
downloadgdrive-48221145e64d65fb7afc1dba40e6f41bb7b76e7d.tar.bz2
Fix error check
-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