aboutsummaryrefslogtreecommitdiffstats
path: root/drive/download.go
diff options
context:
space:
mode:
Diffstat (limited to 'drive/download.go')
-rw-r--r--drive/download.go3
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 {