Skip to content

Commit 18bbd80

Browse files
authored
adds retryablehttp client in place of standard (#168)
1 parent f1f4434 commit 18bbd80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/provider/provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"os"
99

10+
"github.com/hashicorp/go-retryablehttp"
1011
"github.com/hashicorp/terraform-plugin-framework/datasource"
1112
"github.com/hashicorp/terraform-plugin-framework/path"
1213
"github.com/hashicorp/terraform-plugin-framework/provider"
@@ -128,6 +129,9 @@ func (p *segmentProvider) Configure(ctx context.Context, req provider.ConfigureR
128129
URL: url,
129130
},
130131
}
132+
retryClient := retryablehttp.NewClient()
133+
retryClient.RetryMax = 10
134+
configuration.HTTPClient = retryClient.StandardClient()
131135

132136
client := api.NewAPIClient(configuration)
133137

0 commit comments

Comments
 (0)