modify
This commit is contained in:
@@ -101,6 +101,7 @@ abstract class Pool extends Component
|
|||||||
$names[] = $name;
|
$names[] = $name;
|
||||||
$this->pop($channel, $name, $retain_number);
|
$this->pop($channel, $name, $retain_number);
|
||||||
}
|
}
|
||||||
|
$this->_items = [];
|
||||||
if ($retain_number == 0) {
|
if ($retain_number == 0) {
|
||||||
Timer::clear($this->creates);
|
Timer::clear($this->creates);
|
||||||
$this->creates = -1;
|
$this->creates = -1;
|
||||||
@@ -128,6 +129,9 @@ abstract class Pool extends Component
|
|||||||
*/
|
*/
|
||||||
protected function pop($channel, $name, $retain_number): void
|
protected function pop($channel, $name, $retain_number): void
|
||||||
{
|
{
|
||||||
|
if (Coroutine::getCid() === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
while ($channel->length() > $retain_number) {
|
while ($channel->length() > $retain_number) {
|
||||||
$connection = $channel->pop();
|
$connection = $channel->pop();
|
||||||
if ($connection) {
|
if ($connection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user