Skip to content

Commit

Permalink
Add retry logic when configuring the Go SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Jun 22, 2023
1 parent 904e472 commit f8aa35d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package acctest

import (
"context"
"net/http"
"os"
"testing"

Expand Down Expand Up @@ -65,6 +66,7 @@ func configureTestProviderWithHTTPRecordings(httpRecorder *recorder.Recorder) sc
management.WithStaticToken("insecure"),
management.WithClient(httpRecorder.GetDefaultClient()),
management.WithDebug(debug),
management.WithRetries(3, []int{http.StatusTooManyRequests, http.StatusInternalServerError}),
}

if domain != RecordingsDomain {
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
"context"
"fmt"
"net/http"

"github.com/auth0/go-auth0"
"github.com/auth0/go-auth0/management"
Expand Down Expand Up @@ -59,6 +60,7 @@ func ConfigureProvider(terraformVersion *string) schema.ConfigureContextFunc {
management.WithDebug(debug),
management.WithUserAgent(userAgent(terraformVersion)),
management.WithAuth0ClientEnvEntry(providerName, version),
management.WithRetries(3, []int{http.StatusTooManyRequests, http.StatusInternalServerError}),
)
if err != nil {
return nil, diag.FromErr(err)
Expand Down

0 comments on commit f8aa35d

Please sign in to comment.