增加 更多事件
This commit is contained in:
parent
12c8c08565
commit
41e91b16de
@ -38,7 +38,7 @@ public function handle(): int
|
|||||||
|
|
||||||
private function format(string $event, array $message = [])
|
private function format(string $event, array $message = [])
|
||||||
{
|
{
|
||||||
$status = $this->switch($event);
|
$status = $this->switch($event, $message['data']);
|
||||||
|
|
||||||
if (!$status) {
|
if (!$status) {
|
||||||
return;
|
return;
|
||||||
@ -49,7 +49,7 @@ private function format(string $event, array $message = [])
|
|||||||
$this->info($message);
|
$this->info($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function switch($event): string|null
|
public function switch($event, $message = []): string|null
|
||||||
{
|
{
|
||||||
$events = [
|
$events = [
|
||||||
'node.ok' => '此节点初始化成功,并且已经加入集群。',
|
'node.ok' => '此节点初始化成功,并且已经加入集群。',
|
||||||
@ -58,7 +58,9 @@ public function switch($event): string|null
|
|||||||
'cluster_ready.ok' => 'Cluster Ready 就绪了,已经可以处理请求了。',
|
'cluster_ready.ok' => 'Cluster Ready 就绪了,已经可以处理请求了。',
|
||||||
'config.updated' => '集群配置文件已经更新,请所有 slave 节点下载。',
|
'config.updated' => '集群配置文件已经更新,请所有 slave 节点下载。',
|
||||||
'config.synced' => '我已下载配置文件。',
|
'config.synced' => '我已下载配置文件。',
|
||||||
'edge.deployed' => '边缘节点已经部署,已经成功根据集群节点生成配置文件并应用。',
|
'edge.deployed' => '已成功根据集群节点生成配置文件并应用。',
|
||||||
|
'edge.launched' => '边缘节点成功启动。',
|
||||||
|
'edge.error' => $message['data']['message'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $events[$event] ?? null;
|
return $events[$event] ?? null;
|
||||||
|
Loading…
Reference in New Issue
Block a user