Ticket #19700: 19700.2.diff
| File 19700.2.diff, 1.9 KB (added by ryan, 5 months ago) |
|---|
-
wp-includes/cron.php
194 194 */ 195 195 function spawn_cron( $local_time = 0 ) { 196 196 197 if ( ! $local_time )198 $local_time = time();197 if ( ! $local_time ) 198 $local_time = microtime( true ); 199 199 200 200 if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) ) 201 201 return; … … 226 226 if ( !empty($_POST) || defined('DOING_AJAX') ) 227 227 return; 228 228 229 $doing_wp_cron = $local_time;229 $doing_wp_cron = sprintf( '%.22F', $local_time ); 230 230 set_transient( 'doing_cron', $doing_wp_cron ); 231 231 232 232 ob_start(); … … 241 241 return; 242 242 } 243 243 244 $doing_wp_cron = $local_time;244 $doing_wp_cron = sprintf( '%.22F', $local_time ); 245 245 set_transient( 'doing_cron', $doing_wp_cron ); 246 246 247 247 $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?doing_wp_cron=' . $doing_wp_cron; … … 264 264 if ( false === $crons = _get_cron_array() ) 265 265 return; 266 266 267 $local_time = time();267 $local_time = microtime( true ); 268 268 $keys = array_keys( $crons ); 269 269 if ( isset($keys[0]) && $keys[0] > $local_time ) 270 270 return; -
wp-cron.php
48 48 die(); 49 49 50 50 $keys = array_keys( $crons ); 51 $local_time = time();51 $local_time = microtime( true ); 52 52 53 53 if ( isset($keys[0]) && $keys[0] > $local_time ) 54 54 die(); … … 61 61 // Called from external script/job. Try setting a lock. 62 62 if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $local_time ) ) 63 63 return; 64 $doing_cron_transient = $doing_wp_cron = time();64 $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); 65 65 set_transient( 'doing_cron', $doing_wp_cron ); 66 66 } else { 67 67 $doing_wp_cron = $_GET[ 'doing_wp_cron' ];
