West-Coast-Devops/scheduled-scaler

Upgrade the cron version so that timezone may be specified

Closed this issue · 6 comments

Newer versions of https://github.com/robfig/cron support TZ and CRON_TZ entries a la environment variables to be prepended to the spec string. This is a very useful feature some of our apps would love to use.

Hi @scr-oath ! timeZone is already supported in SS definitions. Are you suggesting some other behavior?

Well… it's some confusion about libraries using newer cron (v3) when this is stuck on v1.

The newer cron has split the timezone of the cron from the timezone of the schedule spec.

This means you could have a machine/pod on UTC, but schedule the crons specifically with CRON_TZ=Asia/Tokyo 30 04 * * * or the like (see https://godoc.org/github.com/robfig/cron)

I'd love to discuss closer to realtime - where do people normally connect for discussing on github? is there a public slack or IRC somewhere we could meet?

So the newer cron - seems like… if we upgrade SS, I'm worried about impact to others… looking at its code, I see that the v3 cron chooses LocalTime as default for schedule specs… so that means…

If you currently have a TimeZone in the ss (and hence the cron object) of, say PDT, and then don't specify a timezone in your spec, then you'll be scheduling for UTC (assuming your nodes/pods run with that timezone).

I can play with this a little more, but I'm not as excited to upgrade without a discussion.

I'd love to discuss closer to realtime - where do people normally connect for discussing on github? is there a public slack or IRC somewhere we could meet?

Please contact me via email eric@westcoastdevops.com and let me know your email address there and I'll invite you to a slack group where we can engage more fluidly.

More than likely, we'll abandon this one for now - until/unless the per-spec timezone is really needed - will just try the per-ss timezone and see how many apps in the cluster still need this granularity…

Thanks