public static void awaitNextRetry( final Throwable e, @Nullable final String messageOnRetry, final int nTry, final int maxRetries, final boolean quiet ) throws InterruptedException { final long sleepMillis = nextRetrySleepMillis(nTry); final String fullMessage; if (messageOnRetry == null) { fullMessage = StringUtils.format("Retrying (%d of %d) in %,dms.", nTry, maxRetries, sleepMillis); } else { fullMessage = StringUtils.format( "%s, retrying (%d of %d) in %,dms.", messageOnRetry, nTry, maxRetries, sleepMillis ); } if (quiet) { log.debug(e, fullMessage); } else { log.warn(e, fullMessage); } Thread.sleep(sleepMillis); }
long sleepMillis = Math.min( MAX_RETRY_BACKOFF, RetryUtils.nextRetrySleepMillis(consecutiveFailedAttemptCount) ); log.info("Scheduling next syncup in [%d] millis for server[%s].", sleepMillis, logIdentity);
public static void awaitNextRetry( final Throwable e, @Nullable final String messageOnRetry, final int nTry, final int maxRetries, final boolean quiet ) throws InterruptedException { final long sleepMillis = nextRetrySleepMillis(nTry); final String fullMessage; if (messageOnRetry == null) { fullMessage = StringUtils.format("Retrying (%d of %d) in %,dms.", nTry, maxRetries, sleepMillis); } else { fullMessage = StringUtils.format( "%s, retrying (%d of %d) in %,dms.", messageOnRetry, nTry, maxRetries, sleepMillis ); } if (quiet) { log.debug(e, fullMessage); } else { log.warn(e, fullMessage); } Thread.sleep(sleepMillis); }
long sleepMillis = Math.min( MAX_RETRY_BACKOFF, RetryUtils.nextRetrySleepMillis(consecutiveFailedAttemptCount) ); log.info("Scheduling next syncup in [%d] millis for server[%s].", sleepMillis, logIdentity);