Skip to content

Commit

Permalink
Update to exponential backoff instead of liner retry
Browse files Browse the repository at this point in the history
  • Loading branch information
HemanthDogiparthi12 committed Jan 13, 2025
1 parent ba65abb commit 0339ad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion genesyscloud/util/util_retries.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func RetryWhen(shouldRetry checkResponseFunc, callSdk callSdkFunc, additionalCod
if resp != nil && shouldRetry(resp, additionalCodes...) {
// Wait a second and try again
lastErr = sdkErr
time.Sleep(2 * time.Second)
time.Sleep(time.Duration((i+1)*500) * time.Millisecond) // total 27.5 seconds for the 10 retries with exponential backoff on each retry
continue
} else {
return sdkErr
Expand Down

0 comments on commit 0339ad8

Please sign in to comment.