This commit is contained in:
2021-02-24 14:25:24 +08:00
parent cb07c7f1ea
commit 17058e9e41
+2 -3
View File
@@ -25,14 +25,13 @@ class ObjectPool extends \Snowflake\Abstracts\Pool
* ObjectPool constructor. * ObjectPool constructor.
* @param array $config * @param array $config
* @throws ComponentException * @throws ComponentException
* @throws Exception
*/ */
public function __construct($config = []) public function __construct($config = [])
{ {
$this->max = 5000; $this->max = 5000;
listen(Event::EVENT_AFTER_REQUEST, [$this, 'destruct']);
$event = Snowflake::app()->getEvent();
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'destruct']);
parent::__construct($config); parent::__construct($config);
} }