变更
This commit is contained in:
@@ -116,25 +116,6 @@ class Connection extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $config
|
|
||||||
* @return Closure
|
|
||||||
*/
|
|
||||||
public function create($config): Closure
|
|
||||||
{
|
|
||||||
return function () use ($config) {
|
|
||||||
if ($this->total >= 300) {
|
|
||||||
$connect = $this->pool->waite($config['cds'], 60);
|
|
||||||
if (!($connect instanceof \Database\Mysql\PDO)) {
|
|
||||||
throw new Exception("Get database link wait timeout.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->total += 1;
|
|
||||||
return new \Database\Mysql\PDO($config);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param \Database\Mysql\PDO $PDO $PDO
|
* @param \Database\Mysql\PDO $PDO $PDO
|
||||||
@@ -185,16 +166,6 @@ class Connection extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $coroutineName
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function hasClient($coroutineName): bool
|
|
||||||
{
|
|
||||||
return Context::exists($coroutineName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* batch release
|
* batch release
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|||||||
Reference in New Issue
Block a user