mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
fix: remove unnecessary calls to purgeCache (#3502)
This commit is contained in:
parent
965d7d44c5
commit
5e22459eb6
7 changed files with 22 additions and 19 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue