jmettraux/rufus-scheduler

3.3.x problem in CST China Standard Time

Closed this issue · 10 comments

As seen in sidekiq-cron/sidekiq-cron#128

Probably related to #222

$ TZ="Asia/Shanghai" bundle exec ruby -e "require 'rufus-scheduler'; require 'pp'; pp [ '* * * * *', '0 * * * *', '0 16 * * *' ].collect { |s| Rufus::Scheduler::CronLine.new(s).to_a }"
[[[0], nil, nil, nil, nil, nil, nil, "America/Bahia_Banderas"],
 [[0], [0], nil, nil, nil, nil, nil, "America/Bahia_Banderas"],
 [[0], [0], [16], nil, nil, nil, nil, "America/Bahia_Banderas"]]

@zzjin Would you have some time to test this fix in your environment? Thanks in advance.

zzjin commented

@jmettraux using github master@c46b12e still not work.

@zzjin What does

bundle exec ruby -e "require 'rufus-scheduler'; require 'pp'; pp [ '* * * * *', '0 * * * *', '0 16 * * *' ].collect { |s| Rufus::Scheduler::CronLine.new(s).to_a }"

yield for you now with this c46b12e?

Thanks in advance.

zzjin commented

as same as 3.3.1.

[[[0], nil, nil, nil, nil, nil, nil, "America/Bahia_Banderas"],
 [[0], [0], nil, nil, nil, nil, nil, "America/Bahia_Banderas"],
 [[0], [0], [16], nil, nil, nil, nil, "America/Bahia_Banderas"]]

@zzjin and

TZ="Asia/Shanghai" bundle exec ruby -e "require 'rufus-scheduler'; require 'pp'; pp [ '* * * * *', '0 * * * *', '0 16 * * *' ].collect { |s| Rufus::Scheduler::CronLine.new(s).to_a }"

?

zzjin commented

seems correct:

[[[0], nil, nil, nil, nil, nil, nil, "Asia/Shanghai"],
 [[0], [0], nil, nil, nil, nil, nil, "Asia/Shanghai"],
 [[0], [0], [16], nil, nil, nil, nil, "Asia/Shanghai"]]

Thanks a lot, I will try to come up tomorrow with a solution that works without having to set TZ.

@zzjin that should fix it. I tested on a system set to your timezone and it seems OK. If you could give it a try and give me your feedback, that would be much appreciated.

zzjin commented

@jmettraux master@5dd92e8 it works! thanks!

Thanks a lot! I will release 3.3.2 then.