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

Spring DST change skips jobs from executing #65

Open
betelgeuse opened this issue Mar 30, 2020 · 1 comment
Open

Spring DST change skips jobs from executing #65

betelgeuse opened this issue Mar 30, 2020 · 1 comment

Comments

@betelgeuse
Copy link

betelgeuse commented Mar 30, 2020

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

@betelgeuse
Copy link
Author

Could also consider detecting specifications that will skip or run twice with DST changes and issue a warning.

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

1 participant