From 478251788f24839364cbe1fb7fdba476c340ae3d Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 5 Jan 2023 03:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E9=9B=86=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/Log.php | 4 ++++ app/Console/Commands/Cluster/Work.php | 5 +++++ 2 files changed, 9 insertions(+) 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('整个莱云 重启完成。'); }, ];