FIX: nextFuzzyTimestamp in past
This commit is contained in:
parent
1c0ffc7b64
commit
c174a18a4a
@ -92,12 +92,14 @@ public class ScheduleEntry {
|
|||||||
|
|
||||||
public void setNextClearTimestamp(final ZonedDateTime next) {
|
public void setNextClearTimestamp(final ZonedDateTime next) {
|
||||||
nextClearTimestamp = next;
|
nextClearTimestamp = next;
|
||||||
if (nextClearTimestamp == null) {
|
nextFuzzyTimestamp = null;
|
||||||
nextFuzzyTimestamp = null;
|
if (nextClearTimestamp != null) {
|
||||||
} else {
|
|
||||||
final int rangeFull = 2 * fuzzySeconds;
|
final int rangeFull = 2 * fuzzySeconds;
|
||||||
final int fuzzySeconds = rangeFull > 0 ? RANDOM.nextInt(rangeFull) - this.fuzzySeconds : 0;
|
final ZonedDateTime min = ZonedDateTime.now().plusMinutes(1);
|
||||||
nextFuzzyTimestamp = nextClearTimestamp.plusSeconds(fuzzySeconds);
|
while (nextFuzzyTimestamp == null || nextFuzzyTimestamp.isBefore(min)) {
|
||||||
|
final int fuzzySeconds = rangeFull > 0 ? RANDOM.nextInt(rangeFull) - this.fuzzySeconds : 0;
|
||||||
|
nextFuzzyTimestamp = nextClearTimestamp.plusSeconds(fuzzySeconds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user