From 0485a1d95fb7524a36267ac30979290df1eb04ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 19:10:36 +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/Abstracts/Pool.php | 1 - System/Pool/Connection.php | 28 ---------------------------- System/Pool/Redis.php | 11 ----------- 3 files changed, 40 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index c432ba79..c366078a 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -298,7 +298,6 @@ abstract class Pool extends Component if (!$this->_items[$name]->isFull()) { $this->_items[$name]->push($client); } - $this->remove($name); } diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 2abbf5f7..4103c7e7 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -159,26 +159,10 @@ class Connection extends Pool $link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $link->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $link->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING); - -// $this->printClients($config['cds'], '', ''); -// $this->increment($name); - return $link; } - /** - * @param $cds - * @param $coroutineName - * @param false $isBefore - * @throws Exception - */ - public function printClients($cds, $coroutineName, $isBefore = false) - { -// $this->success('create client connect ' . $cds); - } - - /** * @param $coroutineName * @param $isMaster @@ -220,15 +204,6 @@ class Connection extends Pool } - /** - * @param $coroutineName - */ - public function remove($coroutineName) - { - Context::remove($coroutineName); - } - - /** * @param string $name * @param mixed $client @@ -262,9 +237,6 @@ class Connection extends Pool public function disconnect($coroutineName, $isMaster = false) { $coroutineName = $this->name($coroutineName, $isMaster); - if ($this->hasClient($coroutineName)) { - $this->remove($coroutineName); - } $this->clean($coroutineName); } diff --git a/System/Pool/Redis.php b/System/Pool/Redis.php index f5ff36cc..b9423643 100644 --- a/System/Pool/Redis.php +++ b/System/Pool/Redis.php @@ -102,7 +102,6 @@ class Redis extends Pool } $this->push($coroutineName, Context::getContext($coroutineName)); - $this->remove($coroutineName); $this->lastTime = time(); } @@ -117,20 +116,10 @@ class Redis extends Pool $coroutineName = $this->name('redis', 'redis:' . $name, $isMaster); if (Context::hasContext($coroutineName)) { $this->decrement($coroutineName); - - $this->remove($coroutineName); } $this->flush(0); } - /** - * @param $coroutineName - */ - public function remove(string $coroutineName) - { - Context::remove($coroutineName); - } - /** * @param string $name * @param mixed $client