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

Double event #70

Closed
dgomes opened this issue Apr 7, 2024 · 1 comment
Closed

Double event #70

dgomes opened this issue Apr 7, 2024 · 1 comment

Comments

@dgomes
Copy link

dgomes commented Apr 7, 2024

I've setup a cron to execute a batch 1x a month at midnight, I'm in Berlin timezone and started my program on the 23rd February.

Please consider the follow executions:

>>> croniter("0 0 1 * *", datetime(2024, 2, 23, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))).get_next(datetime)
datetime.datetime(2024, 3, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))
>>> croniter("0 0 1 * *", datetime(2024, 3, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))).get_next(datetime)
datetime.datetime(2024, 3, 31, 23, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))
>>> croniter("0 0 1 * *", datetime(2024, 3, 31, 23, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))).get_next(datetime)
datetime.datetime(2024, 4, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))
>>> croniter("0 0 1 * *", datetime(2024, 4, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))).get_next(datetime)
datetime.datetime(2024, 5, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Berlin'))

Even considering DST, there shouldn't have been 2 trigger in March -> April

@kiorky
Copy link
Owner

kiorky commented Apr 7, 2024

Hello, i'm afraid i do not have time to implement a fix for #1 and related bugs, including this one.

If you can submit a PR, i would be glad to review and merge it.

@kiorky kiorky closed this as completed Apr 7, 2024
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