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

DOM list including "L" does not behave as expected

Open kristofarkas opened this issue 3 years ago • 6 comments
trafficstars

A cron expression for every 15th and last day of the month at 12:00 does not behave as expected and skips the last days when asked for next execution time.

Example cron schedule: 0 0 L,15 * *

While the cron expression is "valid" I wonder if this is in fact not supported.

kristofarkas avatar Oct 04 '22 08:10 kristofarkas

@kristofarkas, thank you for reporting this. May we ask you for a PR with a test reproducing the issue? Thanks! 😄

jmrozanec avatar Oct 04 '22 12:10 jmrozanec

Hey @jmrozanec! Here is a repro: https://github.com/jmrozanec/cron-utils/pull/540/files

kristofarkas avatar Oct 04 '22 14:10 kristofarkas

(just a lurker, not part of the project, just trying to help)

"valid" I wonder if this is in fact not supported.

The README for this project says:

Non-standard characters L, W, LW, '?' and # are supported as well!

so I think the intent is for L to be supported.

mccartney avatar Oct 09 '22 19:10 mccartney

When using the ‘L’ option, it is important not to specify lists, or ranges of values, as you’ll get confusing/unexpected results.

This quote is from the quarz cron tutorial here: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html. Is L,15 a list? And if so does it fall under the this quote?

kristofarkas avatar Oct 10 '22 08:10 kristofarkas

Any thoughts on this @jmrozanec? I could contribute a fix (if this is indeed a bug) with some help from you on where to look.

kristofarkas avatar Oct 27 '22 08:10 kristofarkas

@kristofarkas, if the expression is valid, it must be supported as defined in the specification. We will be glad to merge a PR with a valid fix 😄 Thanks!

jmrozanec avatar Oct 27 '22 08:10 jmrozanec