Support » Plugin: WooCommerce » action_scheduler_run_queue event

  • Hello WooCommerce:
    Using WC on a low traffic site, with a few products that are rarely updated.

    Version 3.5.0 added Action Scheduler running every minute.

    I tried 3.5.0 on a test site. I deleted event with wp cron event delete action_scheduler_run_queue.

    Tested products after deleting event. No errors in PHP error log, wc-logs. Also no errors on WC Status.

    Is it safe to run WC on production site without this pesky event running every minute?

    Thank you,
    Mitchell

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support wbrubaker

    (@wbrubaker)

    Howdy Mitchell,

    Define “safe”? Disabling it will, of course, disable the action scheduler from running. As of the current iteration and in the context of the current version of WooCommerce, the action scheduler is only used to schedule/send webhooks so if you are not using webhooks I wouldn’t expect any ill-effects of disabling it. That said, how WooCommerce uses it is subject to change at any given time in the future.

    Other uses for the action scheduler outside of WooCommerce core are WooCommerce Subscriptions and WooCommerce Follow-ups. I’m assuming you use neither of those, but if you do, then disabling the action scheduler will cause those things to not work.

    The action scheduler itself is pretty performant and if it isn’t running anything, then there really is no reason that I can think of to disable it.

    Here’s a bit of insomnia cure if you’re interested in the battle-testing that has been done on the action scheduler https://github.com/Prospress/action-scheduler#battle-tested-background-processing

    Kind regards,

    Hello wbrubaker:
    Thank you for detailed explanation.

    I have no Webhooks, subscriptions, follow ups.

    This event is like spontaneous generation – it keeps coming back.

    I will ignore it.

    Best wishes,
    Mitchell

    Hello wbrubaker:

    I fixed it. Added:

    add_filter('action_scheduler_run_schedule', function($arg) { return 86400; });

    Deactivated plugin, deleted leftover cron events, activated.

    Useless event, running thousands of times daily, is gone.

    Best wishes,
    Mitchell

    Thanks for the code, Mitchell.

    Same problem after update Woocomerce plugin and related add-ons. If someone is in the same problem I suggest to install the plugin WP Control manually. Go to the plugin UI /wp-admin/tools.php?page=crontrol_admin_manage_page and remove the event. Additionally, you could be surprised to see other cron events you don’t mind.

    I have a question that happens if I delete the cron work that runs with woocommerce install a plugin that shows me all the works and it seems too many when I only use subscription and membership of woocommerce and apart about two days ago the wp-cron does not work I have to do it manually to update the web

    Simon Manuel

    (@simonmanuel123)

    Thanks for the code @brainiac! A real life saver there!

    @simonmanuel123 You’re welcome. Glad I could help you.

    @brainiac @julianperez Thanks for both tips. they worked

    @brainiac @julianperez Thanks for both tips, but they didn’t work for me.

    I added the filter, deactivated woocommerce, removed the leftover wc cron events with WP Crontrol, then reactivated woocommerce. The action_scheduler_run_queue event still fails to run.

    @wbrubaker One of my shipping providers uses webhooks – if the event is failing, does that mean the shipping provider’s webhook won’t update parcel-tracking in woocommerce? If it doesn’t impact anything other than scheduling when products are posted at the front end, can I safely ignore the performance issue?

    I also have a second shipping provider that uses the Rest API, which (according to WordPress Site Health) is throwing cURL timeout & loopback critical errors – although my hosting provider (Bluehost) can find no record of it in the server log files. They advised me to come here.

    Are these two issues related at all?

    UPDATE: I just realised I had to remove action_scheduler_run_queue event as well. However, the failure just falls to the next scheduled event (in my case it’s jetpack_sync_cron).

    I noticed this when I was troubleshooting prior to following the advice here. When I deactivate all plugins, then activate only one plugin, there’s always an event scheduler failing (that is – only one plugin active at any given time).

    It seems the only scenario I can create where no scheduled events fail is when no plugins that use scheduled events are active.

    Am I missing something here?

    Another good approach, either on low- or high-volume websites actually, is to disable WordPress cron altogether by adding ‘define(‘DISABLE_WP_CRON’, true)’ to wp-config.php and then running the crons through WP CLI.

    it seems that DISABLE_WP_CRON is not disabling the woocommerce webhooks really.

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