wp-crontrol icon indicating copy to clipboard operation
wp-crontrol copied to clipboard

5 Minutes Cron jobs still dissappearing.

Open mogmachine opened this issue 2 years ago • 3 comments

I note that issue #26 mentioned this quite a while ago. I have a couple of 5 minute cron jobs that keep vanishing completely, all trace from wp_options.

These are critical to my site and there is no mention of 5 minute crons not being possible ...they will work for months and then suddenly vanish - or vanish a couple of times in a week. Are 5 minutes crons still an issue?

mogmachine avatar Jul 14 '23 09:07 mogmachine

Does WP Crontrol show you a warning about this schedule when you view the Settings -> Cron Schedules screen?

I don't think this problem is anything specific to WP Crontrol, as this plugin allows you to manage the cron events and cron schedules on your site but doesn't affect the way that cron events are run, which is still handled by the native functionality in WordPress.

I suspect the underlying issue is the same as what's being reported here: https://core.trac.wordpress.org/ticket/57271 . There is an issue in WordPress core where a cron event may fail to be rescheduled after it succeeds, in which case it gets lost. Extra logging was added for this in WordPress 6.0 but the underlying issue remains.

Some ideas have been put forward for this in https://wordpress.org/support/topic/cron-being-deleted/ but I've not had time to investigate further.

johnbillion avatar Jul 14 '23 11:07 johnbillion

"My advice would be for your plugin to maintain it’s own database entries in a custom table. Then, that custom table checks against the core crons. Any missing ones, are then added again."

Any chance you might be implementing this soon?

mogmachine avatar Jul 18 '23 21:07 mogmachine

Maybe, although it's not a priority for me. It doesn't solve the underlying problem of cron events not being correctly rescheduled, it's mostly a workaround.

I think I would prefer to spend this time investigating the cause in WordPress core.

johnbillion avatar Jul 19 '23 14:07 johnbillion