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

Bug for Complicated Cron Jobs #2

Closed
dprosperino opened this issue Sep 19, 2020 · 2 comments
Closed

Bug for Complicated Cron Jobs #2

dprosperino opened this issue Sep 19, 2020 · 2 comments

Comments

@dprosperino
Copy link
Contributor

Hey!

While building the scheduler, I found that one of my test did not pass and I investigated it a bit.
I don't know where it fails, but I know what does fail:

Taking this cron job description: "*/5 1-6 * 3 2-4"

According to crontab.guru and cronhub.io the next scheduled dates are:
2021-03-02 01:00:00, 2021-03-02 01:05:00, 2021-03-02 01:10:00, 2021-03-02 01:15:00, 2021-03-02 01:20:00

However, when running this code:

exec_time = CronValidator.get_execution_time(expression="*/5 1-6 * 3 2-4", from_dt=datetime.datetime(year=2021, month=2, day=24, hour=9, minute=21, second=46), to_dt=None)
for i in range(10):
    print(next(exec_time))

The output is:
2021-03-03 01:00:00
2021-03-03 01:05:00
2021-03-03 01:10:00
2021-03-03 01:15:00
2021-03-03 01:20:00
2021-03-03 01:25:00
2021-03-03 01:30:00
2021-03-03 01:35:00
2021-03-03 01:40:00
2021-03-03 01:45:00

So it seems, it gets the day wrong.

@dprosperino
Copy link
Contributor Author

This is fixed pull request #3. Consult the pull request for solution of this problem.

@kaka2507
Copy link
Owner

Fixed by above MR

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

2 participants