-
Notifications
You must be signed in to change notification settings - Fork 66
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How to manage timezone ? #645
Comments
All tasks executed at server time |
Though I'm not a go programmer I've taken some time to stare at the code a little while I think it might be feasible to change const sqlSelectChains = sqlSelectLiveChains + ` AND NOT COALESCE(starts_with(run_at, '@'), FALSE) AND timetable.is_cron_in_time(run_at, now())` To const sqlSelectChains = sqlSelectLiveChains + ` AND NOT COALESCE(starts_with(run_at, '@'), FALSE) AND timetable.is_cron_in_time(run_at, now() AT TIME ZONE XXXX)` Where A consequence of this will change the I'm willing to work on this with a little direction if you think this is the right approach. Edit: added idea to use both per chain and cmd line config. |
@gaslitbytech looks nice, |
Nice. I've given it a go with this Draft PR #646 Based on the above I opted for just adding a time zone per chain. My attempts of also adding a config using cmd line argument / environment variable got a little messy so I reverted that. |
If one wants to run pg_timetable in a different time zone just use this: pg_timetable --clientname=bill postgresql://scheduler:somestrong@localhost:5432/timetable?timezone=UTC
-- or
pg_timetable --clientname=bill postgresql://scheduler:somestrong@localhost:5432/timetable?timezone=Etc/GMT+3
-- or
pg_timetable --clientname=bill postgresql://scheduler:somestrong@localhost:5432/timetable?timezone=Asia/Ho_Chi_Minh One can check |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is your feature request related to a problem? Please describe.
I use pg_timetable to send email periodically according to a cron task created by a user.
The cron task is given in the user localtime, but it is exexcuted by pg_timetable as UTC task so I have a gap between the user defined time and the execution time.
I would like to know if pg_timetable handle this case and how. I did not find any reference to timezone into the docs.
The text was updated successfully, but these errors were encountered: