From 17058e9e41596f679d9f64c76ae138f0d8c4b657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 24 Feb 2021 14:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Pool/ObjectPool.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/System/Pool/ObjectPool.php b/System/Pool/ObjectPool.php index eecda4f3..8b76368b 100644 --- a/System/Pool/ObjectPool.php +++ b/System/Pool/ObjectPool.php @@ -25,14 +25,13 @@ class ObjectPool extends \Snowflake\Abstracts\Pool * ObjectPool constructor. * @param array $config * @throws ComponentException + * @throws Exception */ public function __construct($config = []) { $this->max = 5000; - - $event = Snowflake::app()->getEvent(); - $event->on(Event::EVENT_AFTER_REQUEST, [$this, 'destruct']); + listen(Event::EVENT_AFTER_REQUEST, [$this, 'destruct']); parent::__construct($config); }