From 1dacc2598b73d299f084fdde083247d742fe3fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sun, 6 Sep 2020 05:53:40 +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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 1783214f..2b199d44 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -40,9 +40,9 @@ class Connection extends Pool return; } if ($this->lastTime + 600 < time()) { - $this->flush(1); + $this->flush(0); } else if ($this->lastTime + 300 < time()) { - $this->flush(5); + $this->flush(2); } } @@ -55,7 +55,10 @@ class Connection extends Pool $channels = $this->getChannels(); foreach ($channels as $name => $channel) { while ($channel->length() > $retain_number) { - $channel->pop(); + [$timer, $connection] = $channel->pop(); + if ($connection) { + unset($connection); + } $this->desc($name); } }