Commit cc5c4137 by Carsten Brandt

better fix for #2988

parent 18c3e8ef
...@@ -116,7 +116,6 @@ class FileTarget extends Target ...@@ -116,7 +116,6 @@ class FileTarget extends Target
$file = $this->logFile; $file = $this->logFile;
for ($i = $this->maxLogFiles; $i > 0; --$i) { for ($i = $this->maxLogFiles; $i > 0; --$i) {
$rotateFile = $file . '.' . $i; $rotateFile = $file . '.' . $i;
clearstatcache();
if (is_file($rotateFile)) { if (is_file($rotateFile)) {
// suppress errors because it's possible multiple processes enter into this section // suppress errors because it's possible multiple processes enter into this section
if ($i === $this->maxLogFiles) { if ($i === $this->maxLogFiles) {
...@@ -137,5 +136,7 @@ class FileTarget extends Target ...@@ -137,5 +136,7 @@ class FileTarget extends Target
if (is_file($file)) { if (is_file($file)) {
@rename($file, $file . '.1'); // suppress errors because it's possible multiple processes enter into this section @rename($file, $file . '.1'); // suppress errors because it's possible multiple processes enter into this section
} }
// clear stat cache after moving files to later file size check is not cached
clearstatcache();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment