action_scheduler_queue_runner_flush_cache
When an external object cache is in use, and when wp_cache_flush_runtime() is not available, then normally the cache will not be flushed after processing a batch of actions (to avoid a performance penalty for other processes).
This filter makes it possible to override this behavior and always flush the cache, even if an external object cache is in use.
Usage
add_filter( 'action_scheduler_queue_runner_flush_cache', 'wp_kama_action_scheduler_queue_runner_flush_cache_filter' ); /** * Function for `action_scheduler_queue_runner_flush_cache` filter-hook. * * @param bool $flush_cache If the cache should be flushed. * * @return bool */ function wp_kama_action_scheduler_queue_runner_flush_cache_filter( $flush_cache ){ // filter... return $flush_cache; }
- $flush_cache(true|false)
- If the cache should be flushed.
Changelog
Since 1.0 | Introduced. |
Where the hook is called
action_scheduler_queue_runner_flush_cache
woocommerce/packages/action-scheduler/classes/ActionScheduler_QueueRunner.php 216
|| apply_filters( 'action_scheduler_queue_runner_flush_cache', false )