humanmade / Cavalcade

A better wp-cron. Horizontally scalable, works perfectly with multisite.
https://engineering.hmn.md/projects/cavalcade/
Other
512 stars 46 forks source link

Check to see if the job has been running more then 3 hours #126

Open stuartshields opened 4 months ago

stuartshields commented 4 months ago

When a job is stuck (long running jobs) it makes it hard to delete the job when using plugins like WP Crontrol.

This PR is based on a solution that has been tested and is being used on an existing project that allows for us to delete these jobs via WP Control.

Props: @ivankristianto

rmccue commented 4 months ago

I don't want to make specific assumptions in Cavalcade itself about the run time of jobs or similar, as it's designed to be generic infrastructure; a 3 hour job could be normal in the context of a particular site.

From what I see here, the issue is that Crontrol doesn't have any ability to "force" deletion, which kind of makes sense there. If a job is actually currently running, what does it mean to cancel it? Would we need to kill the process? (And what implications does that have for the partially-completed job?)

Ideally, if we could lift this functionality up, that seems like the best option; i.e. add into the Crontrol UI the distinction. This would allow per-project discretion, while also making it clear to the user what the implications are.