Bläddra i källkod

Avoid collecting duplicate logs if the file cannot be locked

Jordi Boggiano 9 månader sedan
förälder
incheckning
2e97231b96
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      src/Monolog/Handler/DeduplicationHandler.php

+ 3 - 1
src/Monolog/Handler/DeduplicationHandler.php

@@ -148,7 +148,9 @@ class DeduplicationHandler extends BufferHandler
             throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore);
         }
 
-        flock($handle, LOCK_EX);
+        if (false === flock($handle, LOCK_EX)) {
+            return;
+        }
         $validLogs = [];
 
         $timestampValidity = time() - $this->time;