Skip to content

Commit

Permalink
adds retryablehttp client in place of standard (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
simpixelated authored Jan 23, 2025
1 parent f1f4434 commit 18bbd80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"os"

"github.com/hashicorp/go-retryablehttp"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/provider"
Expand Down Expand Up @@ -128,6 +129,9 @@ func (p *segmentProvider) Configure(ctx context.Context, req provider.ConfigureR
URL: url,
},
}
retryClient := retryablehttp.NewClient()
retryClient.RetryMax = 10
configuration.HTTPClient = retryClient.StandardClient()

client := api.NewAPIClient(configuration)

Expand Down

0 comments on commit 18bbd80

Please sign in to comment.