1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-20 16:16:37 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2017-03-17 23:01:57 +01:00
3 changed files with 48 additions and 5 deletions

View File

@@ -144,6 +144,17 @@ class SlackHandler extends SocketHandler
protected function write(array $record)
{
parent::write($record);
$this->finalizeWrite();
}
/**
* Finalizes the request by reading some bytes and then closing the socket
*
* If we do not read some but close the socket too early, slack sometimes
* drops the request entirely.
*/
protected function finalizeWrite()
{
$res = $this->getResource();
if (is_resource($res)) {
@fread($res, 2048);