mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 12:17:35 +02:00
Split off work into a new method to facilitate extension, fixes #945
This commit is contained in:
@@ -144,6 +144,17 @@ class SlackHandler extends SocketHandler
|
|||||||
protected function write(array $record)
|
protected function write(array $record)
|
||||||
{
|
{
|
||||||
parent::write($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();
|
$res = $this->getResource();
|
||||||
if (is_resource($res)) {
|
if (is_resource($res)) {
|
||||||
@fread($res, 2048);
|
@fread($res, 2048);
|
||||||
|
Reference in New Issue
Block a user