Browse Source

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

mark_story 14 years ago
parent
commit
4a7bd031e5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/Cake/Cache/Engine/FileEngine.php

+ 3 - 1
lib/Cake/Cache/Engine/FileEngine.php

@@ -240,7 +240,9 @@ class FileEngine extends CacheEngine {
 			}
 			$path = $this->_File->getRealPath();
 			$this->_File = null;
-			unlink($path);
+			if (file_exists($path)) {
+				unlink($path);
+			}
 		}
 		$dir->close();
 		return true;