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/Core.pm

    r2377 r2505  
    774774            }, 
    775775        }, 
     776        'RemoveExpiredSearchCaches' => { 
     777            label => 'Remove Expired Search Caches', 
     778            frequency => 60 * 60 * 24,   # once a day 
     779            code => sub { 
     780                MT::Core->remove_expired_search_caches; 
     781            }, 
     782        }, 
    776783    }; 
    777784} 
     
    803810        $s->remove if !$s->get('remember'); 
    804811    } 
     812    return ''; 
     813} 
     814 
     815sub remove_expired_search_caches { 
     816    require MT::Session; 
     817 
     818    MT::Session->remove( 
     819        { kind => 'CS', start => [ undef, time - 60 * 60 ] }, 
     820        { range => { start => 1 } } ); 
    805821    return ''; 
    806822}