action_scheduler_async_request_sleep_seconds
Chaining async requests can crash MySQL. A brief sleep call in PHP prevents that.
Usage
add_filter( 'action_scheduler_async_request_sleep_seconds', 'wp_kama_action_scheduler_async_request_sleep_seconds_filter', 10, 2 );
/**
* Function for `action_scheduler_async_request_sleep_seconds` filter-hook.
*
* @param $5
* @param $that
*
* @return
*/
function wp_kama_action_scheduler_async_request_sleep_seconds_filter( $5, $that ){
// filter...
return $5;
}
- $5
- -
- $that
- -
Where the hook is called
action_scheduler_async_request_sleep_seconds
woocommerce/packages/action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php 91
return apply_filters( 'action_scheduler_async_request_sleep_seconds', 5, $this );