skedule icon indicating copy to clipboard operation
skedule copied to clipboard

scheduleiterator looping over the same value over and over again

Open Globegitter opened this issue 5 years ago • 4 comments

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?

Globegitter avatar Nov 07 '19 10:11 Globegitter

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.

Globegitter avatar Nov 07 '19 10:11 Globegitter

Interesting, also if I do Schedule.at(LocalTime.MIDNIGHT) or Schedule.at(LocalTime.NOON) it works as expected.

Globegitter avatar Nov 07 '19 11:11 Globegitter

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

Globegitter avatar Nov 07 '19 11:11 Globegitter

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.

Zomis avatar Jan 30 '21 14:01 Zomis