From 6c2d12bec6e65e294d7b5d08862cf2393c61d653 Mon Sep 17 00:00:00 2001 From: stelin <794774870@qq.com> Date: Sun, 26 May 2019 19:42:42 +0800 Subject: [PATCH] Fixed pool maxIdelTime bug --- src/Connection/Connection.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Connection/Connection.php b/src/Connection/Connection.php index 6f3465d..27009a6 100644 --- a/src/Connection/Connection.php +++ b/src/Connection/Connection.php @@ -102,6 +102,7 @@ public function initialize(Pool $pool, Database $database) { $this->pool = $pool; $this->database = $database; + $this->lastTime = time(); // We need to initialize a query grammar and the query post processors // which are both very important parts of the database abstractions @@ -182,11 +183,11 @@ public function create(): void */ public function close(): void { - if(!empty($this->pdo)){ + if (!empty($this->pdo)) { $this->pdo = null; } - if(!empty($this->readPdo)){ + if (!empty($this->readPdo)) { $this->readPdo = null; } } @@ -227,14 +228,6 @@ public function release(bool $force = false): void } } - /** - * @return int - */ - public function getLastTime(): int - { - return time(); - } - /** * @return Grammar */