File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 66 "net/http"
77 "time"
88
9+ "github.com/hashicorp/go-retryablehttp"
910 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging"
1011)
1112
@@ -23,8 +24,13 @@ const (
2324
2425func CreateClient (apiURL , apiToken , userAgent string ) (* ClientWithResponses , error ) {
2526 httpClientOption := func (client * Client ) error {
27+ retries := retryablehttp .NewClient ()
28+ retries .RetryMax = 2
29+
30+ c := retries .StandardClient ()
31+
2632 client .Client = & http.Client {
27- Transport : logging .NewSubsystemLoggingHTTPTransport ("CAST.AI" , http . DefaultTransport ),
33+ Transport : logging .NewSubsystemLoggingHTTPTransport ("CAST.AI" , c . Transport ),
2834 Timeout : 1 * time .Minute ,
2935 }
3036 client .RequestEditors = append (client .RequestEditors , func (_ context.Context , req * http.Request ) error {
You can’t perform that action at this time.
0 commit comments