mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 04:25:07 +00:00
Formatting cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@9403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3a0dc54a26
commit
9479b4ed91
@ -24,7 +24,7 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
|
|||||||
$next = wp_next_scheduled($hook, $args);
|
$next = wp_next_scheduled($hook, $args);
|
||||||
if ( $next && $next <= $timestamp + 600 )
|
if ( $next && $next <= $timestamp + 600 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$crons = _get_cron_array();
|
$crons = _get_cron_array();
|
||||||
$key = md5(serialize($args));
|
$key = md5(serialize($args));
|
||||||
$crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );
|
$crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );
|
||||||
@ -178,7 +178,9 @@ function spawn_cron( $local_time ) {
|
|||||||
if ( $timestamp > $local_time )
|
if ( $timestamp > $local_time )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425');
|
// WPCOM: Use SERVER_ADDR
|
||||||
|
//$cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425');
|
||||||
|
$cron_url = 'http://' . $_SERVER['SERVER_ADDR'] . '/wp-cron.php?check=' . wp_hash('187425');
|
||||||
/*
|
/*
|
||||||
* multiple processes on multiple web servers can run this code concurrently
|
* multiple processes on multiple web servers can run this code concurrently
|
||||||
* try to make this as atomic as possible by setting doing_cron switch
|
* try to make this as atomic as possible by setting doing_cron switch
|
||||||
@ -187,13 +189,13 @@ function spawn_cron( $local_time ) {
|
|||||||
|
|
||||||
// clean up potential invalid value resulted from various system chaos
|
// clean up potential invalid value resulted from various system chaos
|
||||||
if ( $flag != 0 ) {
|
if ( $flag != 0 ) {
|
||||||
if ( $flag > $local_time + 10*60 || $flag < $local_time - 10*60 ) {
|
if ( $flag > $local_time + 10*60 || $flag < $local_time - 10*60 ) {
|
||||||
update_option('doing_cron', 0);
|
update_option('doing_cron', 0);
|
||||||
$flag = 0;
|
$flag = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//don't run if another process is currently running it
|
//don't run if another process is currently running it
|
||||||
if ( $flag > $local_time )
|
if ( $flag > $local_time )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user