feat: ws notify nodes when user traffic is exhausted

This commit is contained in:
xboard
2026-03-25 01:44:55 +08:00
parent 7dacb69275
commit 73a37a07dd
5 changed files with 74 additions and 8 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ class NodeSyncService
/**
* Check if node has active WS connection
*/
private static function isNodeOnline(int $nodeId): bool
public static function isNodeOnline(int $nodeId): bool
{
return (bool) Cache::get("node_ws_alive:{$nodeId}");
}
@@ -125,7 +125,7 @@ class NodeSyncService
/**
* Publish a push command to Redis — picked up by the Workerman WS server
*/
private static function push(int $nodeId, string $event, array $data): void
public static function push(int $nodeId, string $event, array $data): void
{
try {
Redis::publish('node:push', json_encode([