变更
This commit is contained in:
+4
-1
@@ -117,10 +117,13 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function connectPoolInstance()
|
public function connectPoolInstance()
|
||||||
{
|
{
|
||||||
$pool = Config::get('databases.pool.max', 10);
|
|
||||||
if (!empty($this->slaveConfig) && $this->cds != $this->slaveConfig['cds']) {
|
if (!empty($this->slaveConfig) && $this->cds != $this->slaveConfig['cds']) {
|
||||||
|
$pool = $this->pool ?? ['max' => 10, 'min' => 1];
|
||||||
|
|
||||||
$this->connection->initConnections('Mysql:' . $this->slaveConfig['cds'], $pool);
|
$this->connection->initConnections('Mysql:' . $this->slaveConfig['cds'], $pool);
|
||||||
} else {
|
} else {
|
||||||
|
$pool = $this->slaveConfig['pool'] ?? ['max' => 10, 'min' => 1];
|
||||||
|
|
||||||
$this->connection->initConnections('Mysql:' . $this->cds, $pool);
|
$this->connection->initConnections('Mysql:' . $this->cds, $pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user