Changeset 9181

Show
Ignore:
Timestamp:
10/15/08 06:00:42 (3 months 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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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));