mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 08:07:33 +02:00
fix: remove unnecessary calls to purgeCache (#3502)
This commit is contained in:
@@ -78,12 +78,19 @@ class FileCache implements CacheInterface
|
||||
);
|
||||
|
||||
foreach ($cacheIterator as $cacheFile) {
|
||||
if (in_array($cacheFile->getBasename(), ['.', '..', '.gitkeep'])) {
|
||||
$basename = $cacheFile->getBasename();
|
||||
$excluded = [
|
||||
'.' => true,
|
||||
'..' => true,
|
||||
'.gitkeep' => true,
|
||||
];
|
||||
if (isset($excluded[$basename])) {
|
||||
continue;
|
||||
} elseif ($cacheFile->isFile()) {
|
||||
if (filemtime($cacheFile->getPathname()) < time() - $seconds) {
|
||||
$filepath = $cacheFile->getPathname();
|
||||
if (filemtime($filepath) < time() - $seconds) {
|
||||
// todo: sometimes this file doesn't exists
|
||||
unlink($cacheFile->getPathname());
|
||||
unlink($filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user