This commit is contained in:
2020-09-06 05:53:40 +08:00
parent 590de739bc
commit 1dacc2598b
+6 -3
View File
@@ -40,9 +40,9 @@ class Connection extends Pool
return; return;
} }
if ($this->lastTime + 600 < time()) { if ($this->lastTime + 600 < time()) {
$this->flush(1); $this->flush(0);
} else if ($this->lastTime + 300 < time()) { } else if ($this->lastTime + 300 < time()) {
$this->flush(5); $this->flush(2);
} }
} }
@@ -55,7 +55,10 @@ class Connection extends Pool
$channels = $this->getChannels(); $channels = $this->getChannels();
foreach ($channels as $name => $channel) { foreach ($channels as $name => $channel) {
while ($channel->length() > $retain_number) { while ($channel->length() > $retain_number) {
$channel->pop(); [$timer, $connection] = $channel->pop();
if ($connection) {
unset($connection);
}
$this->desc($name); $this->desc($name);
} }
} }