ccronexpr icon indicating copy to clipboard operation
ccronexpr copied to clipboard

cron_prev 29-feb infinite loop

Open JJM1987 opened this issue 5 years ago • 3 comments

cron_prev function infinite loop on 29 February. Issue occurs in non leap years.

Example infinite loop: Expression: "* * * 29 2 *" Current time: 2021-12-7 12:00:00

Example correct result: Expression: "* * * 29 2 *" Current time: 2020-12-7 12:00:00

JJM1987 avatar Dec 07 '20 15:12 JJM1987

Thanks for the report! This is a nasty bug, will try to fix it.

staticlibs avatar Dec 08 '20 21:12 staticlibs

Hi,

was this bug ever fixed?

Thank you!

BR

alenloncaric avatar May 25 '21 08:05 alenloncaric

@alenloncaric Just tried adding check_next("* * * 29 2 *", "2021-12-07_12:00:00", "2024-02-29_00:00:00"); to the tests and it seems to work as expected (at lease on my toolchain with minor local changes).

Probably it makes sense to check it yourself.

ghseb avatar Sep 14 '21 08:09 ghseb

@ghseb He complains about cron_prev and not cron_next.

exander77 avatar Sep 07 '23 16:09 exander77

This is the same bug as: https://github.com/staticlibs/ccronexpr/issues/35

exander77 avatar Sep 07 '23 18:09 exander77

This project is no longer maintained, see its updated and extended fork in exander77/supertinycron repo, closing the issue to archive the repo.

staticlibs avatar Sep 10 '23 12:09 staticlibs