提交 0f800a8b 编写于 作者: weixin_47267244's avatar weixin_47267244

优化代码

上级 07dad03a
......@@ -79,12 +79,12 @@ class AMQPResource extends BasePoolResource
try
{
$channel->close();
unset($this->connection->channels[$key]);
}
catch (\Exception $e)
catch (\Throwable $e)
{
/* Ignore closing errors */
}
unset($this->connection->channels[$key]);
}
}
......
......@@ -79,7 +79,10 @@ class QueueConsumer extends BaseConsumer
$this->stop();
}
$this->connection = $this->getConnection();
$this->channel = $this->connection->channel();
if($this->connection->isConnected())
{
$this->channel = $this->connection->channel();
}
}
/**
......
......@@ -183,7 +183,7 @@ class SwooleIO extends AbstractIO
if (false === $buffer)
{
throw new AMQPRuntimeException('Error sending data');
throw new AMQPRuntimeException('Error sending data, errno=' . $this->sock->errCode);
}
if (0 === $buffer && !$this->sock->connected)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册