Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lastExecution calculates incorrect result for less-than-annual schedules #402

Closed
sbandler opened this issue Oct 28, 2019 · 3 comments · Fixed by #453
Closed

lastExecution calculates incorrect result for less-than-annual schedules #402

sbandler opened this issue Oct 28, 2019 · 3 comments · Fixed by #453
Assignees
Milestone

Comments

@sbandler
Copy link

lastExecution seems to be ignoring the quartz year field when calculating the lastExecution.

Setting "now" to 1/15/2015 0:0:0:0 UTC, using quartz expression "0 0 0 1 3 ? 2001/2", the last execution should be 3/1/2013, however the result produced is 3/1/2014.

If you generate last execution and check if its a match, it returns false.

if you generate next execution, it returns the correct result.

if you generate next execution and then the last before that, it returns an incorrect result.

@jmrozanec
Copy link
Owner

@sbandler thank you for reporting this. Can you submit a PR with the corresponding tests for the issue? Thanks! 😄

@IndeedSi
Copy link

May I take this issue? I still need some time but should be able to get this fixed tomorrow.

jmrozanec added a commit that referenced this issue Oct 12, 2020
@jmrozanec
Copy link
Owner

@IndeedSi sure! Go ahead!

IndeedSi added a commit to IndeedSi/cron-utils that referenced this issue Oct 13, 2020
…and correcting previous value calculation in EveryFieldValueGenerator
jmrozanec added a commit that referenced this issue Oct 13, 2020
#402 Fix every x years behavior by checking offset in range and correcting previous value calculation in EveryFieldValueGenerator
@jmrozanec jmrozanec added this to the next milestone Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment