Replies: 5 comments 2 replies
-
All tasks executed at server time |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
@gaslitbytech looks nice, |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions