Skip to content

How-to Guides

Technical References

Tools for Site Management /

Cron control

By default, Cron Control will only run one event of a given type (i.e. with the same action) at any one time. This is designed to avoid issues where multiple events simultaneously write to the same values in the database, particularly in alloptions, causing issues with data loss.

In some circumstances, multiple events with the same action can safely run in parallel. This document explains how to permit these events and specify the concurrency for them.

When to increase concurrency for a Cron event

If you are expecting only low numbers of your Cron event at any one time, i.e. less than 5, then it is not worth increasing concurrency.

Caution

If your event writes data to an option which is autoloader, it is not safe for increased concurrency.

How to increase Cron event concurrency

To specify the concurrency level for an event, filter the a8c_cron_control_concurrent_event_whitelist hook, adding the event to the array using the action name as the key and an integer representing the number of simultaneous events of that action which you want to run. Here is an example:

/*
 * Increase Cron Control's concurrency limit for my_async_send_ping action to 10
 */
add_filter( 'a8c_cron_control_concurrent_event_whitelist', function( $wl ) {
    $wl['my_async_send_ping'] = 10;
    return $wl;
} );

If you have any doubts or questions, please send us a support ticket and we’ll be happy to help.

Last updated: November 20, 2020