WordPress.org

Make WordPress Core

Ticket #6966: cron-ignore-duplicate-events-r7916.3.patch

File cron-ignore-duplicate-events-r7916.3.patch, 621 bytes (added by tellyworth, 7 years ago)
  • wp-includes/cron.php

     
    11<?php 
    22 
    33function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 
     4        // don't schedule a duplicate if there's already an identical event due in the next 10 minutes 
     5        $next = wp_next_scheduled($hook, $args); 
     6        if ( $next && $next <= $timestamp + 600 ) 
     7                return; 
     8                 
    49        $crons = _get_cron_array(); 
    510        $key = md5(serialize($args)); 
    611        $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );