Closed arunvelsriram closed 2 years ago
@arunvelsriram thank you for reporting this. May we ask you to send a PR with a test? Thanks! 😄
When looking into it, I think the problem is with default handling of Always
values. So for an expression like * */2 * * *
the handling of more specific values (left of */2
) and less specific values (right of */2
) is the same. Namely empty String. While it should be different.
I am not fully sure, but I think it should be:
*
from the right, they result in empty String,i.e. https://github.com/jmrozanec/cron-utils/blob/864f9f09af58bd48133a1492a09fb7fbc1c5858b/src/main/java/com/cronutils/descriptor/DescriptionStrategy.java#L99 is too optimistic. It should have a conditional logic depending on what position of the expression is it.
For
* */2 * * *
the expected description should be something like "every minute of every second hour". But actual description that we are getting is "every 2 hours".Sorry if this a know bug already. I searched the issues but can't find anything related.