fix computing retry delay in case only jitter is set
@@ -115,8 +115,7 @@ class RetryContext {
*
* @return an exception to rethrow or null if we should try again
*/
- Exception delayIfNeeded() {
- if (delay > 0) {
+ private Exception delayIfNeeded() {
long jitterBase = config.getJitter();
long jitter = (long) (Math.random() * ((jitterBase * 2) + 1)) - jitterBase; // random number between -jitter and +jitter
try {
@@ -125,7 +124,6 @@ class RetryContext {
Thread.currentThread().interrupt();
return e;
}
- }
return null;
}
