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