From 321c2561007bd73614b19873208a1bdc53cd8008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 16 Aug 2023 16:33:56 +0800 Subject: [PATCH] qqq --- Connection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Connection.php b/Connection.php index 58aadb9..b369818 100644 --- a/Connection.php +++ b/Connection.php @@ -151,12 +151,12 @@ class Connection extends Component protected function getNormalClientHealth(): PDO { [$client, $time] = $this->pool()->get($this->cds); - if ((time() - $time) > $this->idle_time) { - return $this->getNormalClientHealth(); - } - if ($this->canUse($client)) { + if ((time() - $time) < $this->idle_time || $this->canUse($client)) { return $client; + } + $this->pool()->abandon($this->cds); + Waite::sleep(10); return $this->getNormalClientHealth(); }