pg_cron icon indicating copy to clipboard operation
pg_cron copied to clipboard

[Feature Request] Add a function to stop a running job

Open pyrocks opened this issue 2 years ago • 1 comments

Hi, It would be nice to have a cron.stop(job_id/job_name) to stop a running job without unscheduling it. I assume it is the nicer equivalent of finding the pid of the job and calling pg_cancel_backend it (or `pg_terminate_backend if a force flag was used).

should be similar to DBMS_SCHEDULER.STOP_JOB from Oracle.

Also: I don't know if it's intended or not - but unscheduling a job using cron.unschedule doesn't stop it if it is running. I would assume it should. maybe related to #178

Thanks

pyrocks avatar Feb 27 '23 08:02 pyrocks

You may want to check another schedule pg_timetable. It has everything you've mentioned

pashagolub avatar Apr 04 '23 09:04 pashagolub