modify
This commit is contained in:
@@ -127,7 +127,6 @@ abstract class Pool extends Component
|
||||
*/
|
||||
protected function pop($channel, $name, $retain_number): void
|
||||
{
|
||||
if ($channel->errCode == 0) {
|
||||
while ($channel->length() > $retain_number) {
|
||||
$connection = $channel->pop();
|
||||
if ($connection) {
|
||||
@@ -135,9 +134,6 @@ abstract class Pool extends Component
|
||||
}
|
||||
$this->decrement($name);
|
||||
}
|
||||
} else {
|
||||
$this->clearCreateLog($name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -268,9 +264,6 @@ abstract class Pool extends Component
|
||||
public function hasItem(string $name): bool
|
||||
{
|
||||
if (isset($this->_items[$name])) {
|
||||
if ($this->_items[$name]->errCode == -2) {
|
||||
$this->_items[$name] = new Channel($this->max);
|
||||
}
|
||||
return !$this->_items[$name]->isEmpty();
|
||||
}
|
||||
return false;
|
||||
@@ -286,7 +279,7 @@ abstract class Pool extends Component
|
||||
if (!Context::inCoroutine()) {
|
||||
return 0;
|
||||
}
|
||||
if (!isset($this->_items[$name]) || $this->_items[$name]->errCode == -2) {
|
||||
if (!isset($this->_items[$name])) {
|
||||
return 0;
|
||||
}
|
||||
return $this->_items[$name]->length();
|
||||
@@ -305,9 +298,6 @@ abstract class Pool extends Component
|
||||
if (!isset($this->_items[$name])) {
|
||||
$this->_items[$name] = new Channel($this->max);
|
||||
}
|
||||
if ($this->_items[$name]->errCode == -2) {
|
||||
$this->_items[$name] = new Channel($this->max);
|
||||
}
|
||||
if (!$this->_items[$name]->isFull()) {
|
||||
$this->_items[$name]->push($client);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user