modify plugin name
This commit is contained in:
@@ -95,21 +95,17 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function get(mixed $config): ?PDO
|
public function get(mixed $config): ?PDO
|
||||||
{
|
{
|
||||||
$coroutineName = $config['cds'];
|
|
||||||
if (isset($this->master[$coroutineName])) {
|
|
||||||
return $this->master[$coroutineName];
|
|
||||||
}
|
|
||||||
$minx = Config::get('databases.pool.min', 1);
|
$minx = Config::get('databases.pool.min', 1);
|
||||||
$connect = $this->pool->get($coroutineName, static function () use ($coroutineName, $config) {
|
return $this->pool->get($config['cds'], static function () use ($config) {
|
||||||
return Kiri::getDi()->create(PDO::class, [$config]);
|
$connect = Kiri::getDi()->create(PDO::class, [$config]);
|
||||||
}, $minx);
|
if (!Db::inTransactionsActive()) {
|
||||||
if (Db::inTransactionsActive()) {
|
return $connect;
|
||||||
|
}
|
||||||
if (!$connect->inTransaction()) {
|
if (!$connect->inTransaction()) {
|
||||||
$connect->beginTransaction();
|
$connect->beginTransaction();
|
||||||
}
|
}
|
||||||
return $this->master[$coroutineName] = $connect;
|
return $connect;
|
||||||
}
|
}, $minx);
|
||||||
return $connect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user