cron-utils icon indicating copy to clipboard operation
cron-utils copied to clipboard

Unix cron expression not taking seconds in consideration

Open tungnath opened this issue 4 years ago • 1 comments

Cron expressions like -> (*/2 * * * *) are supposed to run every two minutes from a scheduler that checks every 10 second if now is the execution time using

ExecutionTime.isMatch(ZonedDateTime zd)

Issue : In the 2nd , 4th , 6th ...... minute, the isMatch(date) method returns true for each of the 10th second in that particular minute. So cron expression runs 6 time instead of 1 time.

So my query was, is it like that only ? or I am making any mistake ?

Need help with this.

Note : Also I tried to build the code from latest branch(9.1.5) as well from the master branch. It didn't build properly. Tests are failing.

tungnath avatar Oct 01 '21 12:10 tungnath

@tungnath thank you for reporting this. May we ask you to provide a PR with some test reproducing the issue? We just checked for the tests, and seem to build ok on JDK16.

jmrozanec avatar Oct 03 '21 06:10 jmrozanec