Skip to content

Commit 2e97231

Browse files
committed
Avoid collecting duplicate logs if the file cannot be locked
1 parent 7ef6b74 commit 2e97231

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Monolog/Handler/DeduplicationHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ private function collectLogs(): void
148148
throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore);
149149
}
150150

151-
flock($handle, LOCK_EX);
151+
if (false === flock($handle, LOCK_EX)) {
152+
return;
153+
}
152154
$validLogs = [];
153155

154156
$timestampValidity = time() - $this->time;

0 commit comments

Comments
 (0)