diff --git a/app/Support/Cluster.php b/app/Support/Cluster.php index 0427235..308ada7 100644 --- a/app/Support/Cluster.php +++ b/app/Support/Cluster.php @@ -36,6 +36,8 @@ public static function publish($event, $data = []): void ], 'data' => $data, ])); + + self::registerThisNode(); } /** @@ -100,7 +102,7 @@ public static function hget($key, $value, $default = null): string|array|null return Redis::hget($key, $value, $default); } - public static function registerThisNode(): void + public static function registerThisNode($report = true): void { $node_id = config('settings.node.id'); @@ -112,6 +114,8 @@ public static function registerThisNode(): void 'last_heartbeat' => time(), ]); - Cluster::publish('node.ok'); + if ($report) { + Cluster::publish('node.ok'); + } } }