RetryHelper: Fix default timeout

The default timeout was set to 5s and the maximum wait in between
retries to 20s. This makes no sense; the wait time would never reach the
maximum allowed before timing out. The intent was to have the timeout be
20s and the wait between retries to be something less than that. Swap
them.

Change-Id: I98f311c3abab21b6c91d3c52f09a5a98751801a1
This commit is contained in:
Dave Borowitz
2017-08-07 14:30:31 -04:00
parent 389d241c30
commit b6b2154e51

View File

@@ -57,12 +57,12 @@ public class RetryHelper {
new BatchUpdate.Factory(migration, reviewDbBatchUpdateFactory, noteDbBatchUpdateFactory);
this.stopStrategy =
StopStrategies.stopAfterDelay(
cfg.getTimeUnit("noteDb", null, "retryTimeout", SECONDS.toMillis(5), MILLISECONDS),
cfg.getTimeUnit("noteDb", null, "retryTimeout", SECONDS.toMillis(20), MILLISECONDS),
MILLISECONDS);
this.waitStrategy =
WaitStrategies.join(
WaitStrategies.exponentialWait(
cfg.getTimeUnit("noteDb", null, "retryMaxWait", SECONDS.toMillis(20), MILLISECONDS),
cfg.getTimeUnit("noteDb", null, "retryMaxWait", SECONDS.toMillis(5), MILLISECONDS),
MILLISECONDS),
WaitStrategies.randomWait(50, MILLISECONDS));
}