3.3.x problem in CST China Standard Time #228

Closed
jmettraux opened this Issue Jan 4, 2017 · 10 comments

Projects

None yet

2 participants

@jmettraux
Owner

As seen in ondrejbartas/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"]]
@jmettraux jmettraux self-assigned this Jan 4, 2017
@jmettraux
Owner
jmettraux commented Jan 4, 2017 edited

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

@zzjin
zzjin commented Jan 4, 2017

@jmettraux using github master@c46b12e still not work.

@jmettraux
Owner

@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
zzjin commented Jan 4, 2017

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"]]
@jmettraux
Owner

@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
zzjin commented Jan 4, 2017

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"]]
@jmettraux
Owner

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

@jmettraux
Owner

@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
zzjin commented Jan 5, 2017

@jmettraux master@5dd92e8 it works! thanks!

@jmettraux
Owner

Thanks a lot! I will release 3.3.2 then.

@jmettraux jmettraux closed this Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment