改名
This commit is contained in:
@@ -285,18 +285,12 @@ abstract class Pool extends Component
|
||||
return;
|
||||
}
|
||||
$channel = $this->_items[$name];
|
||||
while ($client = $channel->pop(0.001)) {
|
||||
unset($client);
|
||||
$this->desc($name);
|
||||
}
|
||||
$this->_items[$name]->close();
|
||||
$this->_items[$name] = null;
|
||||
|
||||
$this->pop($channel, $name, 0);
|
||||
if ($this->creates > -1) {
|
||||
Timer::clear($this->creates);
|
||||
$this->debug('clean timer.');
|
||||
}
|
||||
|
||||
$this->_items[$name] = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -223,23 +223,11 @@ class Connection extends Pool
|
||||
|
||||
/**
|
||||
* batch release
|
||||
* @throws Exception
|
||||
*/
|
||||
public function connection_clear()
|
||||
{
|
||||
$connections = Context::getAllContext();
|
||||
foreach ($connections as $name => $connection) {
|
||||
if (empty($connection) || !($connection instanceof PDO)) {
|
||||
continue;
|
||||
}
|
||||
/** @var PDO $pdoClient */
|
||||
if ($connection->inTransaction()) {
|
||||
$connection->commit();
|
||||
}
|
||||
$this->push($name, $connection);
|
||||
$this->remove($name);
|
||||
}
|
||||
$this->hasCreate = [];
|
||||
$this->creates = 0;
|
||||
$this->flush(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user