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

Update cron library to support time zones in cron schedules #6445

Open
kotcrab opened this issue Oct 30, 2024 · 2 comments
Open

Update cron library to support time zones in cron schedules #6445

kotcrab opened this issue Oct 30, 2024 · 2 comments
Labels
customer Feature asks from customer up-for-grabs Issues that are good entry points for those new to Cadence that want to contribute

Comments

@kotcrab
Copy link
Contributor

kotcrab commented Oct 30, 2024

Is your feature request related to a problem? Please describe.
Some workflows need to run at specific local time as they are related to other business processes. Right now the cron schedule can only be specified in the UTC time zone. This is a problem in countries using DST. We had a time zone change recently and our scheduled workflows started 1 hour earlier than expected. It would be great if time zone could be specified in the cron schedule.

Proposed Solution
It should be enough to update robfig/cron from v1.2.0 to v3.x.x. The new version of the library supports CRON_TZ param and then the schedule can be defined as for example: CRON_TZ=America/New_York 5 4 * * *.

It looks like simple, backwards compatible upgrade, Temporal implemented this in temporalio/temporal#2215.
Seems like tzdata also needs to be added, this was done in temporalio/temporal#2277.

@ibarrajo ibarrajo added customer Feature asks from customer up-for-grabs Issues that are good entry points for those new to Cadence that want to contribute labels Oct 30, 2024
@ibarrajo
Copy link
Contributor

On a tangent, I think this issue might be present depending on the implementation of a pattern I've seen, where a workflow is triggered at a certain time by using delayStartSeconds calculated to a specific timestamp. A developer might encounter the same issue with timezones if he or she does not use a monotonic calendar to measure time between dates and locations.

@demirkayaender
Copy link
Contributor

Yes, this looks like an easy task to do. I will try to prioritize this one soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer Feature asks from customer up-for-grabs Issues that are good entry points for those new to Cadence that want to contribute
Projects
None yet
Development

No branches or pull requests

3 participants