From 6b957646192bf72a5f319c9eea723929095ed9ec Mon Sep 17 00:00:00 2001 From: mtak3 Date: Tue, 19 Aug 2014 17:32:25 +0900 Subject: [PATCH] Ignore RuntimeException RuntimeException is thrown at race condition. However, since for the processing at Garbage Collection, other processes is determined that the expired. this process is acceptable to ignore the RuntimeException even if there is missing file. --- lib/Cake/Cache/Engine/FileEngine.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 684ab1583d0..43eddc5b28b 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -275,7 +275,11 @@ protected function _clearDirectory($path, $now, $threshold) { if (!file_exists($filePath) || is_dir($filePath)) { continue; } - $file = new SplFileObject($path . $entry, 'r'); + try { + $file = new SplFileObject($path . $entry, 'r'); + } catch (RuntimeException $e) { + continue; + } if ($threshold) { $mtime = $file->getMTime();