File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ require (
8
8
github.com/cli/safeexec v1.0.1
9
9
github.com/go-git/go-git/v5 v5.12.0
10
10
github.com/golangci/golangci-lint v1.61.0
11
+ github.com/hashicorp/go-retryablehttp v0.7.7
11
12
github.com/pkg/errors v0.9.1
12
13
github.com/sirupsen/logrus v1.9.3
13
14
github.com/spf13/cobra v1.8.1
@@ -96,6 +97,7 @@ require (
96
97
github.com/gostaticanalysis/comment v1.4.2 // indirect
97
98
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
98
99
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
100
+ github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
99
101
github.com/hashicorp/go-version v1.7.0 // indirect
100
102
github.com/hashicorp/hcl v1.0.0 // indirect
101
103
github.com/henvic/httpretty v0.0.6 // indirect
Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoIS
334
334
github.com/gostaticanalysis/testutil v0.4.0 /go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU =
335
335
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw =
336
336
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 /go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI =
337
+ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ =
338
+ github.com/hashicorp/go-cleanhttp v0.5.2 /go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48 =
339
+ github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k =
340
+ github.com/hashicorp/go-hclog v1.6.3 /go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M =
341
+ github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU =
342
+ github.com/hashicorp/go-retryablehttp v0.7.7 /go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk =
337
343
github.com/hashicorp/go-version v1.2.1 /go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA =
338
344
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY =
339
345
github.com/hashicorp/go-version v1.7.0 /go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA =
Original file line number Diff line number Diff line change @@ -3,11 +3,16 @@ package client
3
3
import (
4
4
"github.com/cli/go-gh"
5
5
"github.com/cli/go-gh/pkg/api"
6
+ "github.com/hashicorp/go-retryablehttp"
6
7
"github.com/pkg/errors"
7
8
)
8
9
9
10
func NewClient (host string ) (api.RESTClient , error ) {
10
- client , err := gh .RESTClient (& api.ClientOptions {Host : host })
11
+ retryableHTTPClient := retryablehttp .NewClient ()
12
+ retryableHTTPClient .RetryMax = 5
13
+ retryableRoundTripper := retryablehttp.RoundTripper {Client : retryableHTTPClient }
14
+
15
+ client , err := gh .RESTClient (& api.ClientOptions {Host : host , Transport : & retryableRoundTripper })
11
16
if err != nil {
12
17
return nil , errors .Wrap (err , "Unable to create GitHub client." )
13
18
}
You can’t perform that action at this time.
0 commit comments