mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-16 03:41:41 +00:00
Fixed timezones for scheduler
This commit is contained in:
parent
07243cee34
commit
0f0208a608
1 changed files with 4 additions and 2 deletions
|
@ -50,6 +50,8 @@ class HuginnScheduler
|
|||
|
||||
rufus_scheduler = Rufus::Scheduler.new
|
||||
|
||||
tzinfo_friendly_timezone = ActiveSupport::TimeZone::MAPPING[ENV['TIMEZONE'].present? ? ENV['TIMEZONE'] : "Pacific Time (US & Canada)"]
|
||||
|
||||
# Schedule event propagation.
|
||||
|
||||
rufus_scheduler.every '1m' do
|
||||
|
@ -58,7 +60,7 @@ class HuginnScheduler
|
|||
|
||||
# Schedule event cleanup.
|
||||
|
||||
rufus_scheduler.cron "0 0 * * * America/Los_Angeles" do
|
||||
rufus_scheduler.cron "0 0 * * * " + tzinfo_friendly_timezone do
|
||||
cleanup_expired_events!
|
||||
end
|
||||
|
||||
|
@ -74,7 +76,7 @@ class HuginnScheduler
|
|||
|
||||
# Times are assumed to be in PST for now. Can store a user#timezone later.
|
||||
24.times do |hour|
|
||||
rufus_scheduler.cron "0 #{hour} * * * America/Los_Angeles" do
|
||||
rufus_scheduler.cron "0 #{hour} * * * " + tzinfo_friendly_timezone do
|
||||
if hour == 0
|
||||
run_schedule "midnight"
|
||||
elsif hour < 12
|
||||
|
|
Loading…
Add table
Reference in a new issue