-
Notifications
You must be signed in to change notification settings - Fork 339
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
Wrong nextRunDate for * rules #153
Comments
The expression should fire on the 0th second of the 0th minute of the 1st hour of every 3rd month (3,6,9,12), so that would be intended. The If you want to fire on 1,4,7,10, you are better off using |
Sorry but you're wrong. This lib is "CRON for PHP" so it should follow CRON rules I suppose. |
January, April, July, October are not every three months. |
Then start position can be set with |
As I'm getting conflicting information depending on the source I'm looking at, I'm going to go through the cronie source and see exactly what it's doing. I'll re-open this ticket for now. Changing the range to At best this will get fixed in the current I doubt the impending v2.0.0 library, which requires PHP 7, will be compatible with Laravel any time soon, as Laravel In the meantime, you should be able to use |
Thanks. You're right, it's different for non zero based date components. |
I learned two things - I hate digging through other people's C code and we are doing According to the cronie source code, Since this changes a fundamental bit of logic, this will definitely only be going into v2.x and I'm going to treat it as a BC-breaking change. The library has been out too long and too many people may be relying on the bad logic, effectively turning this from a bug to a "feature," in a way. Thank you @decadence for bringing this up. |
This is exactly what I learned recently about cron * |
@dragonmantank any updates on this or v2? |
@leeoniya I just pushed a big update for a bunch of validation fixes, so this is next on the radar. |
This should now be fixed in the latest master. Sorry this took so long, I spent a bunch of time getting the validation fixed, which made this fix easier. The I'd appreciate it if you could take a look. The unit tests pass, but some better real world testing would be great. I'll leave this issue open for a while. Thanks! |
@dragonmantank Thanks for your work. I can't check it because I don't use your library directly in any project but I believe you handled it right :) |
2.x has been released over at https://github.com/dragonmantank/cron-expression with the latest fixes (more info available at http://ctankersley.com/2017/10/12/cron-expression-update/). If you are using this package with Laravel (as I'm assuming most of you are in this issue chain), I'll be working with them to get this updated in their next release. |
@dragonmantank respect for your bug-hunting and -solving skills 👍 Will have a look at the new fork. The "only" major change is that expressions as mentioned in this issue are now properly evaluated? No other migration steps required? |
Thanks for library.
But it gives wrong result for * rules (
0 0 1 */3 *
should run 1,4,7,10 month, in fact it runs on 3,6,9,12).Please see this discussion for more info.
The text was updated successfully, but these errors were encountered: