From 3ac3de256274240ba273717619cb438c37257b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sat, 5 Sep 2020 03:03:02 +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 --- Database/Command.php | 3 --- System/Pool/Connection.php | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Database/Command.php b/Database/Command.php index 22753d8c..432e25e8 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -219,7 +219,6 @@ class Command extends Component private function execute($type, $isInsert = null, $hasAutoIncrement = true) { try { - $time = microtime(true); if ($type === static::EXECUTE) { $result = $this->insert_or_change($isInsert, $hasAutoIncrement); } else { @@ -228,8 +227,6 @@ class Command extends Component if ($this->prepare instanceof PDOStatement) { $this->prepare->closeCursor(); } - $time = round(microtime(true) - $time, 6); - $this->debug($this->sql . ' Run-Time:' . $time); } catch (\Throwable | Exception $exception) { $this->error($this->sql . '. error: ' . $exception->getMessage()); $result = null; diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 6e1beb7f..18aef57b 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -160,10 +160,10 @@ class Connection extends Pool return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); } [$timeout, $connection] = $client = $this->get($coroutineName); - if (!($connection instanceof PDO)) { - return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); + if ($connection instanceof PDO) { + return $this->saveClient($coroutineName, $connection); } - return $this->saveClient($coroutineName, $connection); + return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); }