Skip to content

Commit 6edc97d

Browse files
committed
retry: add comments to getNextRetryIntervalMillis.
1 parent 395a30b commit 6edc97d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

examples/here-oauth-client-example/dependency-reduced-pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>here-aaa-sdk</artifactId>
55
<groupId>com.here.account</groupId>
6-
<version>0.4.22</version>
6+
<version>0.4.23-SNAPSHOT</version>
77
<relativePath>../../pom.xml</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
@@ -71,7 +71,7 @@
7171
<dependency>
7272
<groupId>junit</groupId>
7373
<artifactId>junit</artifactId>
74-
<version>4.11</version>
74+
<version>4.13.1</version>
7575
<scope>test</scope>
7676
<exclusions>
7777
<exclusion>

here-oauth-client/src/main/java/com/here/account/oauth2/retry/Socket5xxExponentialRandomBackoffPolicy.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public boolean shouldRetry(RetryContext retryContext) {
4141
|| (null != retryContext.getLastException() && retryContext.getLastException().getCause() instanceof SocketTimeoutException);
4242
}
4343

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

0 commit comments

Comments
 (0)