This commit is contained in:
2021-04-27 14:00:20 +08:00
parent 1a76b21143
commit aeb31eefac
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -182,6 +182,7 @@ class Connection extends Pool
/**
* @param $coroutineName
* @param $isMaster
* @throws Exception
*/
public function release($coroutineName, $isMaster)
{
@@ -190,6 +191,8 @@ class Connection extends Pool
return;
}
$this->error('recover db client ' . $coroutineName);
/** @var PDO $client */
$client = Context::getContext($coroutineName);
if ($client->inTransaction()) {
@@ -241,7 +244,7 @@ class Connection extends Pool
try {
if (empty($client) || !($client instanceof PDO)) {
$result = false;
} else {
} else {
$result = true;
}
} catch (Error | Throwable $exception) {