WordPress.org

Plugin Directory

Changeset 501866


Ignore:
Timestamp:
02/07/12 21:57:05 (2 years ago)
Author:
josephscott
Message:

Attempt to force the scheduled re-check to be no more than 20 minutes in
the future, no matter what happens.

Location:
akismet/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • akismet/trunk/admin.php

    r487737 r501866  
    304304        function akismet_warning() { 
    305305            global $wpdb; 
     306                akismet_fix_scheduled_recheck(); 
    306307                $waiting = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" ) ); 
    307308                $next_check = human_time_diff( wp_next_scheduled('akismet_schedule_cron_recheck') ); 
     
    662663    global $wpdb, $akismet_api_host, $akismet_api_port; 
    663664 
     665    akismet_fix_scheduled_recheck(); 
     666 
    664667    if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) ) 
    665668        return; 
  • akismet/trunk/akismet.php

    r488425 r501866  
    375375            add_filter('pre_comment_approved', 'akismet_result_hold'); 
    376376        } 
    377         wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' ); 
     377        if ( !wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) { 
     378            wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' ); 
     379        } 
    378380    } 
    379381     
     
    387389    } 
    388390    $akismet_last_comment = $commentdata; 
     391 
     392    akismet_fix_scheduled_recheck(); 
    389393    return $commentdata; 
    390394} 
     
    554558        add_filter( 'comment_text', 'wp_kses_post' );  
    555559} 
     560 
     561function akismet_fix_scheduled_recheck() { 
     562    $future_check = wp_next_scheduled( 'akismet_schedule_cron_recheck' ); 
     563    if ( !$future_check ) { 
     564        return; 
     565    } 
     566 
     567    $check_range = time() + 1200; 
     568    if ( $future_check > $check_range ) { 
     569        wp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' ); 
     570        wp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' ); 
     571    } 
     572} 
  • akismet/trunk/readme.txt

    r488425 r501866  
    3131 
    3232== Changelog == 
     33 
     34= 2.5.6 = 
     35* Add more checks on the scheduled re-check feature, force it to be no more than 20 minutes in the future 
    3336 
    3437= 2.5.5 = 
Note: See TracChangeset for help on using the changeset viewer.