WordPress.org

Make WordPress Core

Changeset 10519


Ignore:
Timestamp:
02/06/2009 10:25:35 PM (11 years ago)
Author:
ryan
Message:

Use transient for doing_cron. see #9048

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-cron.php

    r10472 r10519  
    2727
    2828if (!is_array($crons) || $keys[0] > $local_time) {
    29     update_option('doing_cron', 0);
     29    set_transient('doing_cron', 0);
    3030    return;
    3131}
     
    5454}
    5555
    56 update_option('doing_cron', 0);
     56set_transient('doing_cron', 0);
    5757
    5858die();
  • trunk/wp-includes/cron.php

    r10474 r10519  
    185185    * try to make this as atomic as possible by setting doing_cron switch
    186186    */
    187     $flag = get_option('doing_cron');
     187    $flag = get_transient('doing_cron');
    188188
    189189    // clean up potential invalid value resulted from various system chaos
    190190    if ( $flag != 0 ) {
    191191        if ( $flag > $local_time + 10*60 || $flag < $local_time - 10*60 ) {
    192             update_option('doing_cron', 0);
     192            set_transient('doing_cron', 0);
    193193            $flag = 0;
    194194        }
     
    199199        return;
    200200
    201     update_option( 'doing_cron', $local_time + 30 );
     201    set_transient( 'doing_cron', $local_time + 30 );
    202202
    203203    add_action('wp_head', 'spawn_cron_request');
Note: See TracChangeset for help on using the changeset viewer.