mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-09 03:28:29 +00:00
Make the default timout 5 minutes when timeout is 0 (#2667)
This commit is contained in:
parent
6c6b1f62d9
commit
5b075c1eca
|
@ -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) {
|
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) {
|
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("User-Agent", config.userAgent)
|
||||||
reqHeaders.Set("Content-Type", "application/json")
|
reqHeaders.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
if timeout == 0 {
|
||||||
|
timeout = time.Duration(1) * time.Hour
|
||||||
|
}
|
||||||
|
|
||||||
var res *http.Response
|
var res *http.Response
|
||||||
err := retryTimeDuration(
|
err := retryTimeDuration(
|
||||||
func() error {
|
func() error {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user