From 7ee385879e8098459787baae70f1a68ffaf0e2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 27 Apr 2021 17:39:52 +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 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Database/Command.php b/Database/Command.php index c63e2172..a826ee94 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -173,11 +173,7 @@ class Command extends Component if (microtime(true) - $time > 0.02) { $this->error('get connect time:' . $this->sql . '; ' . (microtime(true) - $time)); } - - if (!($connect instanceof PDO)) { - return $this->addError('数据库繁忙, 请稍后再试.'); - } - if (!($query = $connect->query($this->sql))) { + if (!($query = $connect?->query($this->sql))) { return $this->addError($connect->errorInfo()[2] ?? '数据库异常, 请稍后再试.'); } Coroutine::defer(function () use ($query) {