WordPress.org

Plugin Directory

Changeset 479133


Ignore:
Timestamp:
12/22/11 10:48:56 (2 years ago)
Author:
tott
Message:

Honor improved cron locking changes from WordPress 3.3

Location:
wp-cron-control/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-cron-control/trunk/readme.txt

    r459746 r479133  
    33Tags: wp-cron, cron, cron jobs, post missed schedule, scheduled posts 
    44Donate link: http://hitchhackerguide.com 
    5 Tested up to: 3.1.2 
     5Tested up to: 3.3 
    66Stable tag: trunk 
    77 
     
    3131== ChangeLog == 
    3232 
     33= Version 0.5 = 
     34 
     35* Adjustments for improved cron locking introduced in WordPress 3.3 http://core.trac.wordpress.org/changeset/18659 
     36 
    3337= Version 0.4 = 
    3438 
  • wp-cron-control/trunk/wp-cron-control.php

    r459746 r479133  
    55 Description: get control over wp-cron execution. 
    66 Author: Thorsten Ott, Automattic 
    7  Version: 0.4 
     7 Version: 0.5 
    88 Author URI: http://hitchhackerguide.com 
    99 */ 
     
    238238            // make sure a secret string is provided in the ur 
    239239            if ( isset( $_GET[$secret] ) ) { 
     240             
    240241                // check if there is already a cron request running 
    241242                $local_time = time(); 
    242                 $flag = get_transient('doing_cron'); 
    243                 if ( $flag > $local_time + 10*60 ) 
     243                if ( function_exists( '_get_cron_lock' ) ) 
     244                    $flag = _get_cron_lock(); 
     245                else 
     246                    $flag = get_transient('doing_cron'); 
     247                     
     248                if ( defined( 'WP_CRON_LOCK_TIMEOUT' ) ) 
     249                    $timeout = WP_CRON_LOCK_TIMEOUT; 
     250                else  
     251                    $timeout = 60; 
     252                     
     253                if ( $flag > $local_time + 10 * $timeout ) 
    244254                    $flag = 0; 
    245255                     
    246256                // don't run if another process is currently running it or more than once every 60 sec. 
    247                 if ( $flag + 60 > $local_time ) 
     257                if ( $flag + $timeout > $local_time ) 
    248258                    die( 'another cron process running or previous not older than 60 secs' ); 
    249259                 
    250260                // set a transient to allow locking down parallel requests 
    251261                set_transient( 'doing_cron', $local_time ); 
     262             
     263             
    252264                 
    253265                // if settings allow it validate if there are any scheduled posts without a cron event 
Note: See TracChangeset for help on using the changeset viewer.