变更
This commit is contained in:
@@ -100,12 +100,14 @@ class Connection extends Component
|
||||
if (!$this->pool->hasChannel($name)) {
|
||||
$this->pool->initConnections($name, $config['pool']['max']);
|
||||
}
|
||||
|
||||
return $this->pool->get($name, $this->generate($config));
|
||||
if (!Context::hasContext($name)) {
|
||||
return Context::setContext($name, $this->pool->get($name, $this->generate($config)));
|
||||
if ($isMaster) {
|
||||
if (!Context::hasContext($name)) {
|
||||
return Context::setContext($name, $this->pool->get($name, $this->generate($config)));
|
||||
} else {
|
||||
return Context::getContext($name);
|
||||
}
|
||||
} else {
|
||||
return Context::getContext($name);
|
||||
return $this->pool->get($name, $this->generate($config));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user