Skip to content

Commit

Permalink
retry: add comments to getNextRetryIntervalMillis.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmccracken committed Jul 27, 2021
1 parent 395a30b commit 6edc97d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/here-oauth-client-example/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>here-aaa-sdk</artifactId>
<groupId>com.here.account</groupId>
<version>0.4.22</version>
<version>0.4.23-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -71,7 +71,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public boolean shouldRetry(RetryContext retryContext) {
|| (null != retryContext.getLastException() && retryContext.getLastException().getCause() instanceof SocketTimeoutException);
}

/**
* Employs the exponential random backoff policy using a base of 2 and exponent of number of retries,
* up to a maximum, subject to the configured maxRetryFactor, and multiplied by the retryIntervalMillis.
*
* @param retryContext An instance of {@link RetryContext}
* @return the next retry interval in milliseconds
*/
@Override
public int getNextRetryIntervalMillis(RetryContext retryContext){
int retryCount = retryContext.getRetryCount();
Expand Down

0 comments on commit 6edc97d

Please sign in to comment.