skedule
skedule copied to clipboard
scheduleiterator looping over the same value over and over again
I have a schedule setup as follows:
val now = ZonedDateTime.now(ZoneId.of("UTC"))
val scheduleIterator = Schedule.at(now.plusNanos(1000).toLocalTime()).everyDay().iterate(now)
println(scheduleIterator.next())
println(scheduleIterator.next())
println(scheduleIterator.next())
...
and all calls to next print exactly the same ZonedDateTime. Is that an issue with the library or am I using this somehow wrong?
I have noticed that for example Schedule.parse("every day 09:00").iterate(now)
works like I would have expected and iterates over the future values just fine.
Interesting, also if I do Schedule.at(LocalTime.MIDNIGHT)
or Schedule.at(LocalTime.NOON)
it works as expected.
Ha, if I change my code above to Schedule.at(now.plusMinutes(1).withNano(0).withSecond(0).toLocalTime()).everyDay()
it also works fine. So that does seem like a bug to me and possibly related to https://github.com/shyiko/skedule/issues/1
I also encountered this bug and would very gladly like to see this fixed. It could have caused lots of issues for me if I wouldn't have noticed it (continuously spamming several servers with HTTP requests)
Sadly it doesn't look like this library is maintained at the moment.