// Skip local cache and force refetch of doing_cron transient in case
// another processs updated the cache
$value = wp_cache_get( 'doing_cron', 'transient', true );
// Skip local cache and force refetch of doing_cron transient in case
// another processs updated the cache
$value = wp_cache_get( 'doing_cron', 'transient', true );
if ( empty( $doing_wp_cron ) ) {
if ( empty( $_GET[ 'doing_wp_cron' ] ) ) {
// Called from external script/job. Try setting a lock.
if ( empty( $doing_wp_cron ) ) {
if ( empty( $_GET[ 'doing_wp_cron' ] ) ) {
// Called from external script/job. Try setting a lock.
set_transient( 'doing_cron', $doing_wp_cron );
} else {
$doing_wp_cron = $_GET[ 'doing_wp_cron' ];
set_transient( 'doing_cron', $doing_wp_cron );
} else {
$doing_wp_cron = $_GET[ 'doing_wp_cron' ];
do_action_ref_array( $hook, $v['args'] );
// If the hook ran too long and another cron process stole the lock, quit.
do_action_ref_array( $hook, $v['args'] );
// If the hook ran too long and another cron process stole the lock, quit.