Skip to content

Commit

Permalink
修改连接池开启判断
Browse files Browse the repository at this point in the history
  • Loading branch information
titrxw committed Mar 26, 2020
1 parent 9f6a0c0 commit d8392ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/Core/Cache/ConnectorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function connect($name = 'default') : CacheInterface {
throw new \RuntimeException('Cache is not configured.');
}

if (empty($poolConfig) || empty($poolConfig['enable'])) {
if (!isCo() || empty($poolConfig) || empty($poolConfig['enable'])) {
/**
* @var HandlerAbstract $handlerClass
*/
Expand Down
2 changes: 1 addition & 1 deletion Src/Core/Database/ConnectorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct() {
*/
public function connect(array $config) {
//未设置连接池时,直接返回数据连接对象
if (empty($this->poolConfig[$config['name']]) || empty($this->poolConfig[$config['name']]['enable'])) {
if (!isCo() || empty($this->poolConfig[$config['name']]) || empty($this->poolConfig[$config['name']]['enable'])) {
return $this->getDefaultConnection($config);
}
$pool = $this->getPool($config['name'], $config);
Expand Down

0 comments on commit d8392ab

Please sign in to comment.