File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
sysdig/internal/client/v2 Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
1212 "net/http"
1313 "net/http/httputil"
1414 "strings"
15+ "time"
1516
1617 "github.com/draios/terraform-provider-sysdig/buildinfo"
1718 "github.com/hashicorp/go-retryablehttp"
@@ -186,8 +187,12 @@ func newHTTPClient(cfg *config) *http.Client {
186187 transport .TLSClientConfig = & tls.Config {InsecureSkipVerify : cfg .insecure }
187188 httpClient .HTTPClient = & http.Client {Transport : transport }
188189
189- // Configure retry logic for 409 Conflict errors
190+ // Configure retry logic for 409 Conflict errors with exponential backoff
190191 httpClient .RetryMax = 5
192+ httpClient .RetryWaitMin = 1 * time .Second
193+ httpClient .RetryWaitMax = 30 * time .Second
194+ httpClient .Backoff = retryablehttp .DefaultBackoff // Exponential backoff strategy
195+
191196 httpClient .CheckRetry = func (ctx context.Context , resp * http.Response , err error ) (bool , error ) {
192197 // Use default retry logic for connection errors and 5xx
193198 shouldRetry , checkErr := retryablehttp .DefaultRetryPolicy (ctx , resp , err )
You can’t perform that action at this time.
0 commit comments