forked from leftypol/leftypol
maintenance.php: delete expired filesystem cache
This commit is contained in:
parent
eca2ce0a8f
commit
c31f5a4104
1 changed files with 15 additions and 0 deletions
|
@ -87,5 +87,20 @@ echo "Deleted $deleted_count invalid reports in $delta seconds!\n";
|
|||
$time_tot += $delta;
|
||||
$deleted_tot += $deleted_count;
|
||||
|
||||
if ($config['cache']['enabled'] === 'fs') {
|
||||
$fs_cache = new Vichan\Data\Driver\FsCacheDriver(
|
||||
$config['cache']['prefix'],
|
||||
"tmp/cache/{$config['cache']['prefix']}",
|
||||
'.lock',
|
||||
false
|
||||
);
|
||||
$start = microtime(true);
|
||||
$fs_cache->collect();
|
||||
$delta = microtime(true) - $start;
|
||||
echo "Deleted $deleted_count expired filesystem cache items in $delta seconds!\n";
|
||||
$time_tot = $delta;
|
||||
$deleted_tot = $deleted_count;
|
||||
}
|
||||
|
||||
$time_tot = number_format((float)$time_tot, 4, '.', '');
|
||||
modLog("Deleted $deleted_tot expired entries in {$time_tot}s with maintenance tool");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue