in import/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/cstore/backup/DelayCalculator.java [21:30]
public long getExponentialDelayMillis(int attemptsLeft, int attemptsAmount) {
if (attemptsLeft < 1) {
return maxWaitingTimeBtwUpload;
}
if (attemptsLeft > attemptsAmount) {
return minUploadDelay;
}
long delay = (long) (minUploadDelay + (Math.round(Math.pow(DELAY_CALCULATION_BASE, attemptsAmount - attemptsLeft + 1)) - DELAY_CALCULATION_BASE) * MILS_MUL);
return (delay >= maxWaitingTimeBtwUpload) ? maxWaitingTimeBtwUpload : delay;
}