pg_cron icon indicating copy to clipboard operation
pg_cron copied to clipboard

FR: Add a per-schedule option to disable logging runs

Open rauanmayemir opened this issue 1 year ago • 3 comments

With a new feature allowing to schedule jobs with second granularity, job_run_details is clogged very-very fast rendering it practically useless, especially if you do want to keep log run details for your critical jobs and discard them for routine queries.

Adding an argument to disable logging per-schedule would be very helpful:

cron.schedule(job_name text, schedule text, command text, log boolean)

rauanmayemir avatar Dec 10 '24 13:12 rauanmayemir

Hello, I am quite interested in this. What I want to know is, do you think the reason for the blockage is because of writing logs?

Can you provide a case? Thank you

TsinghuaLucky912 avatar Dec 20 '24 09:12 TsinghuaLucky912

What blockage? My main concern is not about log inserts adding some kind of load on the server (although it's probably a valid point, too), but purely convenience. 1 job run per second will instantly render job_run_details not very useful as most of the runs will be those second-granilarity schedules.

rauanmayemir avatar Dec 20 '24 13:12 rauanmayemir

Yep, I vote for this. The reason in same. We have important cron job launched rare and want to see log record about this. And several 1 second jobs to emulate one time jobs. They simply read one time jobs from the queue table and execute it. There will be huge amound of useless record. Will be convenient to to disable this per job.

Splarv avatar Mar 20 '25 14:03 Splarv