fix: unblock add-node API and improve online status detection
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-1
@@ -279,14 +279,17 @@ def collect_node_stats() -> dict:
|
||||
matched = [c for c in connections if _match_connection(c, node)]
|
||||
if not matched and single_node and has_connections:
|
||||
matched = connections
|
||||
if not matched and (session_up + session_down) > 0:
|
||||
matched = [None] # 有活跃会话但 Clash 未返回连接详情
|
||||
if not matched and single_node and global_active:
|
||||
up_speed = global_up_speed
|
||||
down_speed = global_down_speed
|
||||
|
||||
online = (
|
||||
len(matched) > 0
|
||||
or (session_up + session_down) > 0
|
||||
or (up_speed + down_speed) > 512
|
||||
or (single_node and global_active)
|
||||
or (single_node and (global_active or has_connections))
|
||||
)
|
||||
|
||||
if online:
|
||||
|
||||
Reference in New Issue
Block a user