pg_cron postgresql delete running job from schedule
Compony uses pg_cron for starting procedures.
But we have some peculiarities:
- We schedule job just inserting rows in cron.jobs without using seqences.
Example
INSERT INTO cron.job
(jobid, schedule, command, nodename, nodeport, "database", username, active, jobname)
VALUES(73, '00 19 * * *', 'call land.sp_load_procedure()', 'localhost', 5433, 'report', 'cron_exec', true, NULL);
- Uncheduling works as simply deletting a row with job.
- Everything worked fine before we made procedure which starts and at the end it must delete from cron some rows and a row by which it was started (anather words delete her own schedule). At dev enviroment I checked and it works perfect - it makes job and then delete schedule with its own start. But in product enviroment I got massage
in run_details - job cancelled.
And interesting thing is that sometimes despite the error I check and it done the job and deleted the schedule. But sometimes I see that schedule isn't deleted and next time the procedure which is still on cron schedule does not run.
Where can I see in documentation cases with error job cancelled.
Or maybe does anybody know what is wrong?
Because my jobs does not start but they are on schedule. Another jobs
work fine