From 89910e6d98af49950f14cdb8da766b3e234d7019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 17:39:18 +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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Database/Command.php b/Database/Command.php index da806390..c63e2172 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -168,7 +168,12 @@ class Command extends Component */ private function search($type): mixed { + $time = microtime(true); $connect = $this->db->getConnect($this->sql); + if (microtime(true) - $time > 0.02) { + $this->error('get connect time:' . $this->sql . '; ' . (microtime(true) - $time)); + } + if (!($connect instanceof PDO)) { return $this->addError('数据库繁忙, 请稍后再试.'); }