Skip to content

Commit

Permalink
Add additonal codes 409 for retry (#1471)
Browse files Browse the repository at this point in the history
* Add additonal codes 409 for retry

* Update to exponential backoff instead of liner retry
  • Loading branch information
HemanthDogiparthi12 authored Jan 13, 2025
1 parent 3b62711 commit d37a573
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func assignUserToWebRtcPhone(ctx context.Context, pp *phoneProxy, userId string,
}

return resp, nil
})
}, 409)
if diagErr != nil {
return diagErr
}
Expand Down
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(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 d37a573

Please sign in to comment.