改进 清理

This commit is contained in:
iVampireSP.com 2023-02-09 19:56:19 +08:00
parent eeddeab5e3
commit 90a0227b7c
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -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);
}
}
}