Show
Ignore:
Timestamp:
06/04/08 07:54:01 (18 months ago)
Author:
fumiakiy
Message:

Purge stale search cache after it finishes processing, and also periodically. BugId:79999

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-39/lib/MT/App/Search.pm

    r2463 r2505  
    173173        return; 
    174174    } 
    175     $app->{cache_driver} = $cache_driver->new( ttl => $app->config->SearchCacheTTL ); 
     175    $app->{cache_driver} = $cache_driver->new( 
     176        ttl => $app->config->SearchCacheTTL, 
     177        kind => 'CS', 
     178    ); 
    176179} 
    177180 
     
    877880    my ( $cb, $app ) = @_; 
    878881    alarm(0) if $app->{__have_throttle}; 
     882    if ( my $cache_driver = $app->{cache_driver} ) { 
     883        $cache_driver->purge_stale( 2 * $app->config->SearchCacheTTL ); 
     884    } 
    879885    1; 
    880886}