modify plugin name

This commit is contained in:
2022-06-17 14:07:16 +08:00
parent 3e609a48ef
commit 4419b7b237
2 changed files with 11 additions and 6 deletions
+3 -3
View File
@@ -123,12 +123,12 @@ class Connection extends Component
/** /**
* @param string $name * @param string $name
* @return void * @return array
* @throws Kiri\Exception\ConfigException * @throws Kiri\Exception\ConfigException
*/ */
public function check(string $name): void public function check(string $name): array
{ {
$this->pool->check($name); return $this->pool->check($name);
} }
+8 -3
View File
@@ -59,21 +59,26 @@ class Pool extends Component
/** /**
* @param $name * @param $name
* @return void * @return array
* @throws ConfigException * @throws ConfigException
*/ */
public function check($name): void public function check($name): array
{ {
$channel = $this->channel($name); $channel = $this->channel($name);
$count = $success = 0;
$lists = []; $lists = [];
while (($pdo = $channel->pop()) instanceof PDO) { while (($pdo = $channel->pop()) instanceof PDO) {
$pdo->check(); $count += 1;
if ($pdo->check()) {
$success += 1;
}
$lists[] = $pdo; $lists[] = $pdo;
} }
foreach ($lists as $list) { foreach ($lists as $list) {
$channel->push($list); $channel->push($list);
} }
return [$count, $success];
} }