From a024fcb76857418597386f24dfbb25a7723520e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sat, 5 Sep 2020 02:51:41 +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/Connection.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index c55e45c2..6e1beb7f 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -159,10 +159,11 @@ class Connection extends Pool if ($this->size($coroutineName) < 1 && $this->hasCreate[$coroutineName] < $this->max) { return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); } - if (!(($client = $this->get($coroutineName)[1]) instanceof PDO)) { - throw new Exception('Connection pool overflow.'); + [$timeout, $connection] = $client = $this->get($coroutineName); + if (!($connection instanceof PDO)) { + return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); } - return $this->saveClient($coroutineName, $client); + return $this->saveClient($coroutineName, $connection); }