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('数据库繁忙, 请稍后再试.'); }