This commit is contained in:
2021-06-29 14:26:31 +08:00
parent ba9086b56b
commit c3d8a92b33
+6 -8
View File
@@ -176,15 +176,13 @@ abstract class Pool extends Component
if (!((static::$_items[$name] ?? null) instanceof Channel)) { if (!((static::$_items[$name] ?? null) instanceof Channel)) {
static::$_items[$name] = $channel; static::$_items[$name] = $channel;
} }
if ($channel->isEmpty()) { if (!$channel->isEmpty()) {
return $this->createClient($name, $callback); $connection = $channel->pop();
} if ($this->checkCanUse($name, $connection)) {
$connection = $channel->pop(); return $connection;
if (!$this->checkCanUse($name, $connection)) { }
return $this->createClient($name, $callback);
} else {
return $connection;
} }
return $this->createClient($name, $callback);
} }