diff --git a/google/transport.go b/google/transport.go index 8ba9ab41..3a6fe0c1 100644 --- a/google/transport.go +++ b/google/transport.go @@ -33,7 +33,7 @@ func isEmptyValue(v reflect.Value) bool { } func sendRequest(config *Config, method, rawurl string, body map[string]interface{}) (map[string]interface{}, error) { - return sendRequestWithTimeout(config, method, rawurl, body, 0) + return sendRequestWithTimeout(config, method, rawurl, body, 5*time.Minute) } func sendRequestWithTimeout(config *Config, method, rawurl string, body map[string]interface{}, timeout time.Duration) (map[string]interface{}, error) { @@ -41,6 +41,10 @@ func sendRequestWithTimeout(config *Config, method, rawurl string, body map[stri reqHeaders.Set("User-Agent", config.userAgent) reqHeaders.Set("Content-Type", "application/json") + if timeout == 0 { + timeout = time.Duration(1) * time.Hour + } + var res *http.Response err := retryTimeDuration( func() error {