Explorar el Código

Avoid collecting duplicate logs if the file cannot be locked

Jordi Boggiano hace 9 meses
padre
commit
2e97231
Se han modificado 1 ficheros con 3 adiciones y 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;