Problem with the cron
First of all, thank you for an excellent plugin.
Secondly, I’d like to ask about an issue encountered with the cron.
After activation of the plugin the WP debug.log is now being flooded with following errors: Cron unschedule event error for hook: [various hooks], Error code: could_not_set, Error message: The cron event list could not be saved.
In the thread https://wordpress.org/support/topic/cron-unschedule-event-error-for-hook/page/9/ I found a following comment:
I had this problem again on my site and noticed that the cron in alloptions stored in the object cache was different than the cron in wp_options in the database.
These values are set by functions such as update_option, but since exclusive control is not performed, if multiple processes/threads (not limited to concurrent cron) set the values at the same time, different values may set.
update_option has a check that does not update unless the value changes, but this check is based on the object cache. Therefore, the same value as in the database bypasses the check, resulting in 0 updates where previously reported. So I added the following code to the theme’s functions.php and the error disappeared.
wp_cache_delete( ‘alloptions’, ‘options’ );
Performance will be affected, but I will see how it goes in this state for now.
Could you kindly advise on this issue?
- You must be logged in to reply to this topic.