This commit is contained in:
2020-09-05 03:03:02 +08:00
parent a024fcb768
commit 3ac3de2562
2 changed files with 3 additions and 6 deletions
-3
View File
@@ -219,7 +219,6 @@ class Command extends Component
private function execute($type, $isInsert = null, $hasAutoIncrement = true) private function execute($type, $isInsert = null, $hasAutoIncrement = true)
{ {
try { try {
$time = microtime(true);
if ($type === static::EXECUTE) { if ($type === static::EXECUTE) {
$result = $this->insert_or_change($isInsert, $hasAutoIncrement); $result = $this->insert_or_change($isInsert, $hasAutoIncrement);
} else { } else {
@@ -228,8 +227,6 @@ class Command extends Component
if ($this->prepare instanceof PDOStatement) { if ($this->prepare instanceof PDOStatement) {
$this->prepare->closeCursor(); $this->prepare->closeCursor();
} }
$time = round(microtime(true) - $time, 6);
$this->debug($this->sql . ' Run-Time:' . $time);
} catch (\Throwable | Exception $exception) { } catch (\Throwable | Exception $exception) {
$this->error($this->sql . '. error: ' . $exception->getMessage()); $this->error($this->sql . '. error: ' . $exception->getMessage());
$result = null; $result = null;
+3 -3
View File
@@ -160,11 +160,11 @@ class Connection extends Pool
return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config)); return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config));
} }
[$timeout, $connection] = $client = $this->get($coroutineName); [$timeout, $connection] = $client = $this->get($coroutineName);
if (!($connection instanceof PDO)) { if ($connection instanceof PDO) {
return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config));
}
return $this->saveClient($coroutineName, $connection); return $this->saveClient($coroutineName, $connection);
} }
return $this->saveClient($coroutineName, $this->nowClient($coroutineName, $config));
}
/** /**