Skip to content

Commit 407cd67

Browse files
committed
fix:database:解决多次抛出异常导致的回收重复
1 parent cdde155 commit 407cd67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/database/src/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ protected function call($name, $arguments = [])
5757
return $this->call($name, $arguments);
5858
} else {
5959
// 丢弃连接
60-
if ($this->driver) {
60+
// 有可能多次抛出异常,需要判断是否为 EmptyDriver
61+
if ($this->driver && !$this->driver instanceof EmptyDriver) {
6162
$this->driver->__discard();
6263
$this->driver = new EmptyDriver();
6364
}

0 commit comments

Comments
 (0)