Make WordPress Core

Changeset 4509 for trunk/wp-cron.php


Ignore:
Timestamp:
11/21/2006 02:48:12 AM (20 years ago)
Author:
ryan
Message:

Attempt at eliminating cron contention.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-cron.php

    r4424 r4509  
    66if ( $_GET['check'] != md5(DB_PASS . '187425') )
    77        exit;
     8
     9if ( get_option('doing_cron') > time() )
     10        exit;
     11
     12update_option('doing_cron', time() + 30);
    813
    914$crons = _get_cron_array();
    … …  
    1520        foreach ($cronhooks as $hook => $keys) {
    1621                foreach ($keys as $key => $args) {
    17                         do_action_ref_array($hook, $args['args']);
    1822                        $schedule = $args['schedule'];
    1923                        if ($schedule != false) {
    … …  
    2226                        }
    2327                        wp_unschedule_event($timestamp, $hook, $args['args']);
     28                        do_action_ref_array($hook, $args['args']);
    2429                }
    2530        }
    2631}
     32
     33update_option('doing_cron', 0);
     34
    2735?>
Note: See TracChangeset for help on using the changeset viewer.