diff --git a/kiri-engine/Pool/PoolItem.php b/kiri-engine/Pool/PoolItem.php index d622e497..c81b92c0 100644 --- a/kiri-engine/Pool/PoolItem.php +++ b/kiri-engine/Pool/PoolItem.php @@ -106,13 +106,10 @@ class PoolItem */ public function pop(int $waite = 10): mixed { - if (!$this->_items->isEmpty()) { + if ($this->_items->isEmpty()) { + return call_user_func($this->callback); + } else { return $this->_items->pop(); } - if ($this->created > $this->maxCreated) { - return $this->_items->pop($waite); - } - $this->created += 1; - return call_user_func($this->callback); } }