diff --git a/app/Console/Commands/Cluster/Log.php b/app/Console/Commands/Cluster/Log.php index 6e7550f..3b8b1d3 100644 --- a/app/Console/Commands/Cluster/Log.php +++ b/app/Console/Commands/Cluster/Log.php @@ -61,6 +61,10 @@ public function switch($event, $message = []): string|null 'edge.deployed' => '已成功根据集群节点生成配置文件并应用。', 'edge.launched' => '边缘节点成功启动。', 'edge.error' => $message['message'] ?? '未知错误', + 'cluster.restart.web' => '正在重启 web 服务。', + 'cluster.restart.all' => '正在重启 整个 服务。', + 'cluster.restarted.web' => 'Web 重启好了。', + 'cluster.restarted.all' => '整个 重启好了。', ]; return $events[$event] ?? null; diff --git a/app/Console/Commands/Cluster/Work.php b/app/Console/Commands/Cluster/Work.php index e53c3d8..2f07d28 100644 --- a/app/Console/Commands/Cluster/Work.php +++ b/app/Console/Commands/Cluster/Work.php @@ -5,6 +5,7 @@ use App\Support\Cluster; use Illuminate\Console\Command; use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Redis; use Illuminate\Support\Str; use Symfony\Component\Console\Command\Command as CommandAlias; @@ -178,6 +179,8 @@ private function dispatchEvent($event, $message = []): void exec('supervisorctl restart lae-web:*'); + Cluster::publish('cluster.restarted.web'); + $this->info('Web 重启完成。'); }, 'cluster.restart.all' => function () { @@ -185,6 +188,8 @@ private function dispatchEvent($event, $message = []): void exec('supervisorctl restart all'); + Cluster::publish('cluster.restarted.all'); + $this->info('整个莱云 重启完成。'); }, ];