1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 02:40:24 +02:00

Avoid collecting duplicate logs if the file cannot be locked

This commit is contained in:
Jordi Boggiano
2025-04-03 13:44:45 +02:00
parent 7ef6b74dfd
commit 2e97231b96

View File

@@ -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;