• Hi there.

    We noted several PHP errors and decided to do a clean up for the custom code and DB (optimization). We are still see this error in our logs:

    [16-Oct-2024 08:45:08 UTC] Cron reschedule event error for hook: action_scheduler_run_queue, Error code: could_not_set, Error message: The cron event list could not be saved., Data: {“schedule”:”every_minute”,”args”:[“WP Cron”],”interval”:60} [17-Oct-2024 01:07:22 UTC] Cron reschedule event error for hook: action_scheduler_run_queue, Error code: could_not_set, Error message: The cron event list could not be saved., Data: {“schedule”:”every_minute”,”args”:[“WP Cron”],”interval”:60} [17-Oct-2024 10:01:21 UTC] Cron reschedule event error for hook: action_scheduler_run_queue, Error code: could_not_set, Error message: The cron event list could not be saved., Data: {“schedule”:”every_minute”,”args”:[“WP Cron”],”interval”:60}

    WP-CRON is also not showing any details as to why this is happening.

    Here are the details of our set up:

    WP Version: 6.6.2
    WP Memory Limit: 4 GB

    PHP Version: 8.1.29

    WC Version: 9.3.3

    Action Scheduler Version: ? 3.8.1

    Is there a bug with a specific version that we should be aware of and how can we resolve it please.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Wp-cron tasks aren’t very reliable when they’re run too frequently. Every minute IMO is too frequent. I suggest nothing less than every 10 minutes. There’s no hard and fast limitation, success depends on a number of individual server factors. 10 minutes could still be too frequent in some cases.

    If you absolutely require code to run every minute, I suggest you utilize true server Cron jobs instead of relying on wp-cron.

    Hello @timveck ,

    Scheduling cron jobs to run too frequently (e.g., every 60 seconds) can strain server resources, increase server load, and create database overhead, leading to performance degradation. Many tasks don’t require such frequent execution, and lower traffic can result in missed executions.

    Using wp-cron for tasks less than 15 minutes is discouraged by PHPCS to a Codesniffer which checks for best PHP/WordPress practices.

    Warning message:

    Scheduling crons at 60 sec ( less than 15 minutes ) is discouraged.
    (WordPress.WP.CronInterval.CronSchedulesInterval)phpcs
    .

    As @bcworkz mentioned please use server’s CRON if you need to execute your logic every 60 seconds. Or increase the time interval to something above 15 minutes.

    Hope this helps. Let me know if you need any further help in this issue.

    Thread Starter timveck

    (@timveck)

    Thank you Gentlemen.

    Unfortunately this set up was done by the previous developer, I have inherited many legacy customizations which is causing me much trouble.

    Thanks again for this advice.

    Thread Starter timveck

    (@timveck)

    Is there a possibility of this frequency done deliberately by the previous developer due to other poorly done customizations in the site and WooCommerce so that they can run better? I know that’s an ambiguous question but I am unsure of any unforeseen complications that may arise should I increase the interval.

    Moderator bcworkz

    (@bcworkz)

    Running a wp-cron task every 60 sec certainly would not cause Woo to run better. If anything, it’s quite the opposite. Without knowing what a cron task is doing every 60 sec, it’s impossible to judge whether running at a longer interval would cause any harm. You could arbitrarily increase the interval, then do some testing to see if there are any adverse effects. If it happens 60 sec is truly necessary and if server Cron is not available for some reason, maybe instead the task could run on the request of whichever pages are affected by the current wp-cron task. Results could be cached for later use in the near future so the task only needs to execute on requests greater than 60 sec apart.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.