Skip to content

Commit

Permalink
retry for 3 times
Browse files Browse the repository at this point in the history
  • Loading branch information
Ye Yang committed Aug 15, 2019
1 parent 8f9cb44 commit 484e217
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion driver/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var privateKeyPath string
var netRcPath string

var ErrEncryptedKey = errors.New("private keys with passphrases are not supported")
var RetriesOnErrorWriteVersion = 3

func init() {
gitRepoDir = filepath.Join(os.TempDir(), "semver-git-repo")
Expand Down Expand Up @@ -53,7 +54,7 @@ func (driver *GitDriver) Bump(bump version.Bump) (semver.Version, error) {

var newVersion semver.Version

for i := 1; i <= maxRetries; i++ {
for i := 1; i <= RetriesOnErrorWriteVersion; i++ {
err = driver.setUpRepo()
if err != nil {
return semver.Version{}, err
Expand Down

0 comments on commit 484e217

Please sign in to comment.