Explorar o código

Avoid collecting duplicate logs if the file cannot be locked

Jordi Boggiano hai 9 meses
pai
achega
2e97231
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;