From 90a0227b7c9ba7eae5f365ecfb939c3be0d6fd60 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 9 Feb 2023 19:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/CleanOffline.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Console/Commands/Cluster/CleanOffline.php b/app/Console/Commands/Cluster/CleanOffline.php index 54d46c2..4b3e2a4 100644 --- a/app/Console/Commands/Cluster/CleanOffline.php +++ b/app/Console/Commands/Cluster/CleanOffline.php @@ -36,6 +36,12 @@ public function handle(): int if ($now - $node['last_heartbeat'] > 30) { $this->info("节点 {$node['id']} 已离线,将被清理。"); ClusterSupport::removeNode($node['id']); + + if ($node['type'] == 'edge') { + // 移除前 5 个字符,即 "edge-"。 + $id = substr($node['id'], 5); + ClusterSupport::removeNode($id); + } } }