mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +02:00
Merge remote-tracking branch 'milos-silni/add-support-ms-writetimeout' into main
This commit is contained in:
@@ -354,8 +354,9 @@ class SocketHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
private function writingIsTimedOut(int $sent): bool
|
private function writingIsTimedOut(int $sent): bool
|
||||||
{
|
{
|
||||||
$writingTimeout = (int) floor($this->writingTimeout);
|
// convert to ms
|
||||||
if (0 === $writingTimeout) {
|
$writingTimeoutMs = $this->writingTimeout * 1000;
|
||||||
|
if (0 === $writingTimeoutMs) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,7 +369,10 @@ class SocketHandler extends AbstractProcessingHandler
|
|||||||
usleep(100);
|
usleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((time() - $this->lastWritingAt) >= $writingTimeout) {
|
// convert to ms
|
||||||
|
$lastWritingMs = (time() - $this->lastWritingAt) * 1000;
|
||||||
|
|
||||||
|
if ($lastWritingMs >= $writingTimeoutMs) {
|
||||||
$this->closeSocket();
|
$this->closeSocket();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user