@Override protected boolean shouldRetry(Exception ex) { failed = true; return super.shouldRetry(ex); }
@Override protected boolean shouldRetry(Exception ex) { failed = true; return super.shouldRetry(ex); }
@Override protected final void runOneIteration() throws Exception { try { if (nonFailureStartTime == 0L) { nonFailureStartTime = System.currentTimeMillis(); } delayMillis = runTask(); nonFailureStartTime = 0L; failureCount = 0; } catch (Exception e) { if (!shouldRetry(e)) { throw e; } long delayMillis = retryStrategy.nextRetry(++failureCount, nonFailureStartTime); if (delayMillis < 0) { e.addSuppressed(new RetriesExhaustedException(String.format("Retries exhausted after %d failures and %d ms.", failureCount, System.currentTimeMillis() - nonFailureStartTime))); delayMillis = Math.max(0L, handleRetriesExhausted(e)); nonFailureStartTime = 0L; failureCount = 0; } this.delayMillis = delayMillis; } }
@Override protected final void runOneIteration() throws Exception { try { if (nonFailureStartTime == 0L) { nonFailureStartTime = System.currentTimeMillis(); } delayMillis = runTask(); nonFailureStartTime = 0L; failureCount = 0; } catch (Exception e) { if (!shouldRetry(e)) { throw e; } long delayMillis = retryStrategy.nextRetry(++failureCount, nonFailureStartTime); if (delayMillis < 0) { e.addSuppressed(new RetriesExhaustedException(String.format("Retries exhausted after %d failures and %d ms.", failureCount, System.currentTimeMillis() - nonFailureStartTime))); delayMillis = Math.max(0L, handleRetriesExhausted(e)); nonFailureStartTime = 0L; failureCount = 0; } this.delayMillis = delayMillis; } }