WordPress.org

Plugin Directory


Ignore:
Timestamp:
10/02/17 10:13:31 (2 months ago)
Author:
hideokamoto
Message:

v4.3.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c3-cloudfront-clear-cache/trunk/module/model/invalidation.php

    r1525076 r1739459  
    5252            return; 
    5353        } 
     54        $interval_minutes = apply_filters( 'c3_invalidation_cron_interval', 1 ); 
    5455        $query = $this->_merge_transient_invalidation_query( $query ); 
    55         set_transient( self::C3_CRON_INDALITATION_TARGET , $query , 5 * 60 ); 
    56         $time = time() + MINUTE_IN_SECONDS * 5; 
     56        set_transient( self::C3_CRON_INDALITATION_TARGET , $query , $interval_minutes * MINUTE_IN_SECONDS * 1.5 ); 
     57        $time = time() + MINUTE_IN_SECONDS * $interval_minutes; 
    5758        wp_schedule_single_event( $time, 'c3_cron_invalidation'); 
    5859    } 
     
    6364     * @since 4.3.0 
    6465     * @access public 
    65      * @param array $query 
    6666     **/ 
    6767    public function cron_invalidation() { 
     
    9393            $query['Paths']['Items'] = array_merge( array_unique( $query['Paths']['Items'] ) ); 
    9494            $item_count = count( $query['Paths']['Items'] ); 
    95             if ( 10 < $item_count ) { 
     95            if ( apply_filters( 'c3_invalidation_item_limits', 100) < $item_count ) { 
    9696                $query['Paths'] = array( 
    9797                    'Quantity' => 1, 
     
    166166    private function _do_invalidation( $cf_client, $query ) { 
    167167        try { 
    168             set_transient( self::C3_INVALIDATION_KEY , true , 5 * 60 ); 
     168            set_transient( self::C3_INVALIDATION_KEY , true , apply_filters( 'c3_invalidation_interval', 1 ) * 60 ); 
    169169            $result = $cf_client->createInvalidation( $query ); 
    170170            return true; 
Note: See TracChangeset for help on using the changeset viewer.