This commit is contained in:
2023-04-03 13:56:46 +08:00
parent fb84e7cebd
commit ebe679914d
-29
View File
@@ -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 \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
* @throws Exception