This commit is contained in:
2023-08-29 22:27:47 +08:00
parent e53e3afb39
commit 08e0b2b723
+1 -6
View File
@@ -23,9 +23,6 @@ class PoolItem
private int $created = 0; private int $created = 0;
protected int $busy_total = 0;
protected int $idle_total = 0;
/** /**
* @param int $maxCreated * @param int $maxCreated
* @param Closure|array $callback * @param Closure|array $callback
@@ -122,7 +119,6 @@ class PoolItem
$connection->stopHeartbeatCheck(); $connection->stopHeartbeatCheck();
} }
$connection = null; $connection = null;
$this->created -= 1;
} }
} }
@@ -142,8 +138,7 @@ class PoolItem
*/ */
public function pop(int $waite = 10): mixed public function pop(int $waite = 10): mixed
{ {
if ($this->_items->isEmpty() && $this->created < $this->maxCreated) { if ($this->_items->isEmpty()) {
$this->created += 1;
return call_user_func($this->callback); return call_user_func($this->callback);
} else { } else {
return $this->_items->pop($waite); return $this->_items->pop($waite);