Skip to content

Commit

Permalink
feat: ✨ allow codecommit client to have a high retry count
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChung committed Feb 28, 2024
1 parent b2302ea commit d82905e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:

.PHONY: test
test:
go test -v
go test -v ./...

.PHONY: release
release:
Expand All @@ -13,7 +13,7 @@ release:

.PHONY: tag
tag: update docs
git tag -a v0.0.0-beta.$$(date +"%Y%m%d") -m v0.0.0-beta.$$(date +"%Y%m%d")
git tag -a v0.1.0 -m v0.1.0

.PHONY: local
local:
Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewCmd() *cobra.Command {
rootCmd := &cobra.Command{
Use: "cprl",
Short: "cprl",
Version: "v0.0.0-beta",
Version: "v0.1.0",
Run: func(cmd *cobra.Command, args []string) {
val := os.Getenv("CPRL_DOCS")
if val != "" {
Expand Down
2 changes: 1 addition & 1 deletion cmd/codecommit/pr/approve/approve.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewCmd() *cobra.Command {
return cmd
}

func runCmd(cmd *cobra.Command, args []string) {
func runCmd(cmd *cobra.Command, _ []string) {
cfg, err := config.NewCodeCommitConfig(cmd)
util.ExitOnErr(err)
repos, err := config.GetRepositories(cfg.Profile)
Expand Down
4 changes: 3 additions & 1 deletion pkg/client/codecommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ func newCodeCommitClient(profile string) (*codecommit.Client, error) {
return nil, err
}

return codecommit.NewFromConfig(cfg), nil
return codecommit.NewFromConfig(cfg, func(o *codecommit.Options) {
o.RetryMaxAttempts = 1000
}), nil
}

func NewCodeCommitClient(profile string) (*CodeCommitClient, error) {
Expand Down

0 comments on commit d82905e

Please sign in to comment.