Skip to content

Commit

Permalink
fix:database:解决多次抛出异常导致的回收重复
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Sep 1, 2021
1 parent cdde155 commit 407cd67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/database/src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ protected function call($name, $arguments = [])
return $this->call($name, $arguments);
} else {
// 丢弃连接
if ($this->driver) {
// 有可能多次抛出异常,需要判断是否为 EmptyDriver
if ($this->driver && !$this->driver instanceof EmptyDriver) {
$this->driver->__discard();
$this->driver = new EmptyDriver();
}
Expand Down

0 comments on commit 407cd67

Please sign in to comment.