Skip to content

Commit

Permalink
Make duration calculation clearer, fixing linting issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cudevmaxwell committed Apr 8, 2021
1 parent 1005959 commit f7cb6f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ func RetrySubmitJob(maxRetries int, url *url.URL, timeout int, key string, param
if err != nil {
// We encountered some error, retry with backoff.
log.Println("Failed to submit job: ", err)
sleepDur := time.Duration((retry+1)*(retry+1)) * time.Second
sleepSeconds := (retry + 1) * (retry + 1)
sleepDur := time.Duration(sleepSeconds) * time.Second
log.Printf("Retrying in %v (%v/%v)\n", sleepDur, retry+1, maxRetries)
time.Sleep(sleepDur)
continue
Expand Down

0 comments on commit f7cb6f7

Please sign in to comment.