mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding a file_exists() check before unlinking cache files.
This prevents issues where two concurrent requests could be clearing the same cache files. Fixes #1936
This commit is contained in:
parent
1a872e6544
commit
4a7bd031e5
1 changed files with 3 additions and 1 deletions
|
@ -240,8 +240,10 @@ class FileEngine extends CacheEngine {
|
|||
}
|
||||
$path = $this->_File->getRealPath();
|
||||
$this->_File = null;
|
||||
if (file_exists($path)) {
|
||||
unlink($path);
|
||||
}
|
||||
}
|
||||
$dir->close();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue