Skip to content

Commit

Permalink
Merge b0f52a8 into 9afd94b
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisst authored Dec 14, 2018
2 parents 9afd94b + b0f52a8 commit 9e08a51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion third_party/terraform/utils/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ 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)
}

func sendRequestWithTimeout(config *Config, method, rawurl string, body map[string]interface{}, timeout time.Duration) (map[string]interface{}, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("User-Agent", config.userAgent)
reqHeaders.Set("Content-Type", "application/json")

if timeout == 0 {
timeout = time.Duration(5) * time.Minute
}

var res *http.Response
err := retryTimeDuration(
func() error {
Expand Down

0 comments on commit 9e08a51

Please sign in to comment.