mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #196] Problem with cron expressions #140
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LordMike on GitHub (Oct 22, 2018).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/196
Hi,
Very odd. The cron expression engine does not accept
0 2 * * *... It accepts0 1 * * *and0 3 * * *.@cuu508 commented on GitHub (Oct 22, 2018):
Thanks for reporting, looks like a bug indeed. It has something to do with time zones: if I select timezone "Europe/Riga", then "0 2 * * *" works but "0 3 * * *" does not.
Will look into this as soon as I can.
@LordMike commented on GitHub (Oct 22, 2018):
Indeed. Denmark/Copenhagen should be at +2 now, but we're changing in a few days (28th).
I imagine that's the issue. If I go for once a month, I get the correct offsets (we go to +1 there):
... but then this works, so maybe that was a red herring..
( I tested with Berlin, but Copenhagen is the same )
@cuu508 commented on GitHub (Oct 23, 2018):
This was indeed due to DST transitions. When clocks are rolled one hour back or forward, some local times happen twice and some are skipped over. Worked around the ambiguity but will need to do more investigation on how to best handle time jumps in March when DST starts.
This is a hairy problem. I would recommend to keep things simple and:
@pkoziol commented on GitHub (Oct 29, 2018):
I believe European Commision (or Parliament?) voted/recommended recently to stop using DST, so this was probably the last time we changed our clocks in (most of?) the Europe.
@LordMike commented on GitHub (Oct 31, 2018):
They're not done yet. It's still in discussion, and the timetable differes between 2019 and 2021. We'll see :P
@cuu508 commented on GitHub (Dec 14, 2018):
This project is using croniter (https://github.com/kiorky/croniter/) to parse and evaluate cron expressions.
Apparently croniter does work with timezone-aware datetimes too. Just updated Healthchecks to pass timezone-aware datetimes to croniter. By avoiding aware-naive-aware conversions we also avoid the ambiguities around DST transitions.