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

Daylight savings #37

Open
JamesPlayer opened this issue Jan 9, 2018 · 3 comments
Open

Daylight savings #37

JamesPlayer opened this issue Jan 9, 2018 · 3 comments

Comments

@JamesPlayer
Copy link

JamesPlayer commented Jan 9, 2018

I just have a general question. Does clockwork cater for changes to the time by way of daylight savings? So for example you have a database driven schedule (checking for updates every minute) and one of the database rows has a timezone of Pacific/Auckland, to run every week on a Sunday at 3am.

When daylight savings rolls around and the clocks are turned backwards from 3am to 2am, is the scheduled event going to happen at the old 3am (which is now 2am) or the new 3am?

@chukkwagon
Copy link

@JamesPlayer did you ever find an answer to this question?

@JamesPlayer
Copy link
Author

@chukkwagon no I never got an answer but as far as I can tell it doesn't cater to daylight savings changes so I just have a regular cron that runs every minute, checks all records to see if there any that match the current day of the week / time and then spawns a new queued job to run the task if there are any matches.

@chukkwagon
Copy link

Thanks for getting back to me. Interestingly, I do not believe that the following snippet is amenable to DST cutover for daily periods that specify an at argument.

def elapsed_ready?(t)
@last.nil? || (t - @last.to_i).to_i >= @period
end

For a 24 hour period (3am Sunday to 3am monday) daily jobs will not run because the maximum time elapsed will be 23 hours.

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