hasura / hasura/graphql-engine
Cron trigger is adding timezone difference to scheduled_time
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Version: v2.26.0
### What is the current behaviour?
When I create a cron trigger (either using metadata api or hasura console) using a cron expression, hasura is adding timezone difference to scheduled_time. created_at is being created as expected. This makes the scheduling all wrong and trigger wont execute at the expected time.
For example,
If I create a cron trigger with expression : 30 12 * * 3 , it is expected to create a trigger with scheduled_time at 12.30 pm every Wednesday. But what actually happens is that my time zone difference (+5:30 India) is being added to scheduled_time and the resulting schedule will be 6:00 pm every Wednesday. And the event wont fire until 6pm and not 12.30 pm
### What is the expected behaviour?
Cron trigger should work at provided time.
For example,
If I create a cron trigger with expression : 30 12 * * 3 , it is expected to create a trigger with scheduled_time at 12.30 pm every Wednesday.
### How to reproduce the issue?
1. Be in India timezone( or any other)
2. Create a cron trigger using frequently used crons Every Friday noon
3. Check pending events to see the scheduled time as 17:30 instead of 12:00
4. Event wont fire till 17:30
### Screenshots or Screencast


### Any possible solutions/workarounds you're aware of?
I can only think of wring some logic to manually convert cron to -5:30 based on my time zone.
### Keywords
cron_trigger
scheduled_time
utc timezone
Please let me know if it is a know issue or if there are any reported workarounds or solutions.
Contributor guide
Assessment
This issue has not been assessed yet.