On demand feature in pg_timetable #478
-
Hi, I am new to pg_timetable and we are in a process of migrating our databases into Postgres. I am looking for a feature in pg_timetable where the job can be run on-demand. Can anyone please help me to get this done? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello, and thank you for your interest in pg_timetable. Under "on-demand" you mean the operator can start any chain at any time, right? |
Beta Was this translation helpful? Give feedback.
-
One can start any chain on demand and stop any running chain. There are two functions available:
So the algorithm is:
|
Beta Was this translation helpful? Give feedback.
One can start any chain on demand and stop any running chain. There are two functions available:
timetable.notify_chain_start( chain_id BIGINT, worker_name TEXT )
timetable.notify_chain_stop( chain_id BIGINT, worker_name TEXT )
So the algorithm is:
pg_timetable
is running with a proper client name, e.g.--clientname=worker01
psql -d timetable -h localhost -U scheduler
SELECT * FROM timetable.chain
SELECT timetable.notify_chain_start(42, 'worker01')