Changeset 21954
- Timestamp:
- 09/23/2012 04:57:21 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-cron.php
r19722 r21954 49 49 50 50 $keys = array_keys( $crons ); 51 $ local_time = microtime( true );51 $gmt_time = microtime( true ); 52 52 53 if ( isset($keys[0]) && $keys[0] > $ local_time )53 if ( isset($keys[0]) && $keys[0] > $gmt_time ) 54 54 die(); 55 55 … … 60 60 if ( empty( $_GET[ 'doing_wp_cron' ] ) ) { 61 61 // Called from external script/job. Try setting a lock. 62 if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $ local_time ) )62 if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) 63 63 return; 64 64 $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); … … 74 74 75 75 foreach ( $crons as $timestamp => $cronhooks ) { 76 if ( $timestamp > $ local_time )76 if ( $timestamp > $gmt_time ) 77 77 break; 78 78 -
trunk/wp-includes/cron.php
r21293 r21954 193 193 * @return null Cron could not be spawned, because it is not needed to run. 194 194 */ 195 function spawn_cron( $ local_time = 0 ) {196 197 if ( ! $ local_time )198 $ local_time = microtime( true );195 function spawn_cron( $gmt_time = 0 ) { 196 197 if ( ! $gmt_time ) 198 $gmt_time = microtime( true ); 199 199 200 200 if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) ) … … 207 207 $lock = get_transient('doing_cron'); 208 208 209 if ( $lock > $ local_time + 10*60 )209 if ( $lock > $gmt_time + 10*60 ) 210 210 $lock = 0; 211 211 212 212 // don't run if another process is currently running it or more than once every 60 sec. 213 if ( $lock + WP_CRON_LOCK_TIMEOUT > $ local_time )213 if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) 214 214 return; 215 215 … … 220 220 221 221 $keys = array_keys( $crons ); 222 if ( isset($keys[0]) && $keys[0] > $ local_time )222 if ( isset($keys[0]) && $keys[0] > $gmt_time ) 223 223 return; 224 224 … … 227 227 return; 228 228 229 $doing_wp_cron = sprintf( '%.22F', $ local_time );229 $doing_wp_cron = sprintf( '%.22F', $gmt_time ); 230 230 set_transient( 'doing_cron', $doing_wp_cron ); 231 231 … … 242 242 } 243 243 244 $doing_wp_cron = sprintf( '%.22F', $ local_time );244 $doing_wp_cron = sprintf( '%.22F', $gmt_time ); 245 245 set_transient( 'doing_cron', $doing_wp_cron ); 246 246 … … 270 270 return; 271 271 272 $ local_time = microtime( true );272 $gmt_time = microtime( true ); 273 273 $keys = array_keys( $crons ); 274 if ( isset($keys[0]) && $keys[0] > $ local_time )274 if ( isset($keys[0]) && $keys[0] > $gmt_time ) 275 275 return; 276 276 277 277 $schedules = wp_get_schedules(); 278 278 foreach ( $crons as $timestamp => $cronhooks ) { 279 if ( $timestamp > $ local_time ) break;279 if ( $timestamp > $gmt_time ) break; 280 280 foreach ( (array) $cronhooks as $hook => $args ) { 281 281 if ( isset($schedules[$hook]['callback']) && !call_user_func( $schedules[$hook]['callback'] ) ) 282 282 continue; 283 spawn_cron( $ local_time );283 spawn_cron( $gmt_time ); 284 284 break 2; 285 285 }
Note: See TracChangeset
for help on using the changeset viewer.