Make WordPress Core

Changeset 19722


Ignore:
Timestamp:
01/09/2012 07:02:31 PM (15 years ago)
Author:
ryan
Message:

Use microtime() for cron locks. fixes #19700

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-cron.php

    r18659 r19722  
    4949
    5050$keys = array_keys( $crons );
    51 $local_time = time();
     51$local_time = microtime( true );
    5252
    5353if ( isset($keys[0]) && $keys[0] > $local_time )
    … …  
    6262                if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $local_time ) )
    6363                        return;
    64                 $doing_cron_transient = $doing_wp_cron = time();
     64                $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
    6565                set_transient( 'doing_cron', $doing_wp_cron );
    6666        } else {
  • trunk/wp-includes/cron.php

    r19593 r19722  
    195195function spawn_cron( $local_time = 0 ) {
    196196
    197         if ( !$local_time )
    198                 $local_time = time();
     197        if ( ! $local_time )
     198                $local_time = microtime( true );
    199199
    200200        if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
    … …  
    227227                        return;
    228228
    229                 $doing_wp_cron = $local_time;
     229                $doing_wp_cron = sprintf( '%.22F', $local_time );
    230230                set_transient( 'doing_cron', $doing_wp_cron );
    231231
    … …  
    242242        }
    243243
    244         $doing_wp_cron = $local_time;
     244        $doing_wp_cron = sprintf( '%.22F', $local_time );
    245245        set_transient( 'doing_cron', $doing_wp_cron );
    246246
    … …  
    265265                return;
    266266
    267         $local_time = time();
     267        $local_time = microtime( true );
    268268        $keys = array_keys( $crons );
    269269        if ( isset($keys[0]) && $keys[0] > $local_time )
Note: See TracChangeset for help on using the changeset viewer.