diff options
| author | Petter Rasmussen | 2016-04-09 18:04:39 +0200 |
|---|---|---|
| committer | Petter Rasmussen | 2016-04-09 18:37:33 +0200 |
| commit | 0e1057e475525536dce2db4754e9d9840ab086f2 (patch) | |
| tree | e1a1147ba447d8609752594140c82a109772c44c /drive/download.go | |
| parent | 401e017c5e821ba1dff9bc7e45e809b63c800192 (diff) | |
| download | gdrive-0e1057e475525536dce2db4754e9d9840ab086f2.tar.bz2 | |
Configurable timeout as argument #127
Diffstat (limited to 'drive/download.go')
| -rw-r--r-- | drive/download.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drive/download.go b/drive/download.go index 0856258..3cb8310 100644 --- a/drive/download.go +++ b/drive/download.go @@ -19,6 +19,7 @@ type DownloadArgs struct { Recursive bool Delete bool Stdout bool + Timeout time.Duration } func (self *Drive) Download(args DownloadArgs) error { @@ -120,7 +121,7 @@ func (self *Drive) downloadRecursive(args DownloadArgs) error { func (self *Drive) downloadBinary(f *drive.File, args DownloadArgs) (int64, int64, error) { // Get timeout reader wrapper and context - timeoutReaderWrapper, ctx := getTimeoutReaderWrapperContext() + timeoutReaderWrapper, ctx := getTimeoutReaderWrapperContext(args.Timeout) res, err := self.service.Files.Get(f.Id).Context(ctx).Download() if err != nil { |
