Skip to content

Commit

Permalink
fix: lower max attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
ivorscott committed Jul 17, 2024
1 parent 000c7ff commit a35338a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ const (
// StagedCopied means a copied file staged change.
StagedCopied = "C "

// MaxFetchBranchAttempts represents a maximum reties to fetch branches.
MaxFetchBranchAttempts = 30
// MaxAttempts represents maximum reties.
MaxAttempts = 5
)
4 changes: 2 additions & 2 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (g *GitExecutor) hasRemoteURL() bool {
// fetchBranches fetches the branches from the remote and retries on failures.
func (g *GitExecutor) fetchBranches() error {
cmd := exec.Command("git", "-C", g.GitRoot, "fetch", g.RemoteName)
return execCommandWithRetry(cmd, g.GitRoot, g.RemoteName, MaxFetchBranchAttempts)
return execCommandWithRetry(cmd, g.GitRoot, g.RemoteName, MaxAttempts)
}

// branchExistsLocally checks if the desired branch exists locally.
Expand Down Expand Up @@ -179,7 +179,7 @@ var cb *gobreaker.CircuitBreaker
func init() {
settings := gobreaker.Settings{
Name: "GitCommandCircuitBreaker",
MaxRequests: 5,
MaxRequests: MaxAttempts,
Interval: time.Minute,
Timeout: time.Minute,
ReadyToTrip: func(counts gobreaker.Counts) bool {
Expand Down

0 comments on commit a35338a

Please sign in to comment.