From 9e1fc9ab1e006aa203b28b3b9687288951488406 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 2 May 2021 05:40:59 +0800 Subject: [PATCH] modify --- Database/Command.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Database/Command.php b/Database/Command.php index f400a11f..2eaef4ee 100644 --- a/Database/Command.php +++ b/Database/Command.php @@ -121,15 +121,11 @@ class Command extends Component private function execute($type, $isInsert = null, $hasAutoIncrement = null): int|bool|array|string|null { try { - $time = microtime(true); if ($type === static::EXECUTE) { $result = $this->insert_or_change($isInsert, $hasAutoIncrement); } else { $result = $this->search($type); } - if (microtime(true) - $time >= 0.03) { - $this->warning('execute sql Worker.' . env('worker') . '.' . Coroutine::getCid() . '`' . $this->sql . '` use time ' . (microtime(true) - $time)); - } return $result; } catch (\Throwable $exception) { return $this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql'); @@ -144,11 +140,7 @@ 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 (!($query = $connect?->query($this->sql))) { return $this->addError($connect->errorInfo()[2] ?? '数据库异常, 请稍后再试.'); }