From 6230db7a4f3ce6a955ff4661ee381d1b1dc5f3f9 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 4 May 2021 02:43:58 +0800 Subject: [PATCH] modify --- System/Abstracts/Pool.php | 3 ++- System/Pool/Redis.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index e5d2caa1..3b8d595d 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -174,7 +174,7 @@ abstract class Pool extends Component if ($this->_items[$name]->isEmpty()) { $this->createByCallback($name, $callback); } - $connection = $this->_items[$name]->pop(0.002); + $connection = $this->_items[$name]->pop(); if (!$this->checkCanUse($name, $connection)) { return $this->createClient($name, $callback); } else { @@ -297,6 +297,7 @@ abstract class Pool extends Component if (!$this->_items[$name]->isFull()) { $this->_items[$name]->push($client); } + unset($client); } diff --git a/System/Pool/Redis.php b/System/Pool/Redis.php index df76cb37..3350fe44 100644 --- a/System/Pool/Redis.php +++ b/System/Pool/Redis.php @@ -102,6 +102,7 @@ class Redis extends Pool } $this->push($coroutineName, Context::getContext($coroutineName)); + Context::remove($coroutineName); $this->lastTime = time(); } @@ -117,7 +118,8 @@ class Redis extends Pool if (Context::hasContext($coroutineName)) { $this->decrement($coroutineName); } - $this->flush(0); + Context::remove($coroutineName); + $this->flush(0); } /**