forked from adamwiggins/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Requirements:
- set config[:tz] = timezone or have system clock in non UTC
- use :at filter in specifications
- in spring DST change the clock leaps forward
Results:
- All tasks which execute with long interval like 1.day will skip an invocation
Why:
irb(main):016:0> Time.local(2020,3,29,23).in_time_zone(Time.zone)
=> Mon, 30 Mar 2020 02:00:00 EEST +03:00
irb(main):017:0> Time.local(2020,3,23,0).in_time_zone(Time.zone)
=> Mon, 23 Mar 2020 02:00:00 EET +02:00
irb(main):018:0> Time.local(2020,3,29,23).in_time_zone(Time.zone) - Time.local(2020,3,23,0).in_time_zone(Time.zone) >= 1.week
=> false
Suggested mitigation vectors. Thoughts?
- Including a warning in README
- Making the code handle the jump
- under a configuration option?
I think we can work around this for now in our code that uses clockwork by just lowering the trigger interval. The :at filter should make sure they trigger correctly.
This also answer the question in #37
ajsharma, JonKruger, rgardien and adamdullenty
Metadata
Metadata
Assignees
Labels
No labels