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

Expression with increment of ranges not always working as expected #28

Closed
RemkoNolten opened this issue Apr 26, 2013 · 0 comments
Closed

Comments

@RemkoNolten
Copy link

We have the following expression:
0-25/5,40-59/5 4 * * 0 sync content
Which should fire every five minutes on sundays between 4:00 and 5:00 EXCEPT between 4:25 and 4:40 (Don't ask why :))

The problem is that this expression also fires on 4:30 since there appears to be a little error in AbstractField->isInIncrementsOfRanges. It seams that the problem appears when the range starts with a zero (like mine above).

I could fix the issue by changing:

if ($parts[0] == '*' || $parts[0] == 0) {
    return (int) $dateValue % $stepSize == 0;
}

into:

if ($parts[0] == '*' || $parts[0] === '0') {
    return (int) $dateValue % $stepSize == 0;
}

Although I don't fully understand why that second expression is there in the first place.

peter279k pushed a commit to peter279k/cron-expression that referenced this issue Nov 25, 2020
Fixed infinite loop when resolving last weekday of the month from literals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant