UCDavisLibrary/ucdlib-wp-plugins

Error Rescheduling Cron

Closed this issue · 0 comments

Received the following error:

Cron reschedule event error for hook: ucdlib-locations_cron, 
Error code: could_not_set,
Error message: The cron event list could not be saved., 
Data: {"schedule":"ucdlib-locations_hours","args":[],"interval":600}

Which caused the libcal hours to stop updating.

I haven't been able to determine the cause of the problem. Based on some Googling it might be a problem in core, or apparently if a job fails, WP doesn't always reschedule it.

So, let's try wrapping the cron in a try block:
https://github.com/UCDavisLibrary/ucdlib-wp-plugins/blob/main/ucdlib-locations/includes/main.php#L95