WordPress.org

Make WordPress Core

Changeset 9181


Ignore:
Timestamp:
10/15/2008 06:00:42 AM (11 years ago)
Author:
ryan
Message:

don't schedule a duplicate if there's already an identical event due in the next 10 minutes. Props tellyworth. fixes #6966

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cron.php

    r8927 r9181  
    2121 */
    2222function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
     23    // don't schedule a duplicate if there's already an identical event due in the next 10 minutes
     24    $next = wp_next_scheduled($hook, $args);
     25    if ( $next && $next <= $timestamp + 600 )
     26        return;
     27       
    2328    $crons = _get_cron_array();
    2429    $key = md5(serialize($args));
Note: See TracChangeset for help on using the changeset viewer.