eee
This commit is contained in:
+1
-6
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user