debug
This commit is contained in:
@@ -270,6 +270,7 @@ def get_runtime_status() -> dict:
|
||||
runtime_settings = get_runtime_settings()
|
||||
worker_runtime = detect_worker_runtime()
|
||||
sync_agent_runtime = detect_sync_agent_runtime()
|
||||
worker_expected_on_this_node = not (settings.node_region == "overseas" and settings.node_role == "control")
|
||||
api_pid = os.getpid()
|
||||
detect_snapshot = get_detect_status()
|
||||
latest_run = (detect_snapshot.get("runs") or [None])[0] or {}
|
||||
@@ -314,6 +315,35 @@ def get_runtime_status() -> dict:
|
||||
"queue_health": queue_health,
|
||||
"capacity_plan": capacity_plan,
|
||||
}
|
||||
if not worker_expected_on_this_node:
|
||||
detect_payload.update(
|
||||
{
|
||||
"phase_label": "当前节点不承载",
|
||||
"phase_detail": "当前节点为海外控制面,仅承载 API 控制与同步接收,不执行本机检测任务。",
|
||||
"recent_event": "",
|
||||
"recent_warning": "",
|
||||
"progress_percent": 0,
|
||||
"active_thread_count": 0,
|
||||
"max_thread_count": 0,
|
||||
"available_proxy_count": 0,
|
||||
"proxy_pool_count": 0,
|
||||
"proxy_runtime_label": "不适用",
|
||||
"proxy_runtime_detail": "当前节点不承载本机 Worker,代理、线程与检测阶段信息在此节点上不适用。",
|
||||
"proxy_runtime_reason": "not_applicable",
|
||||
"proxy_supplier_empty": False,
|
||||
"proxy_last_refresh_status": "",
|
||||
"proxy_last_refresh_time": "",
|
||||
"proxy_last_refresh_source_count": 0,
|
||||
"proxy_last_refresh_total_items": 0,
|
||||
"proxy_last_validated_count": 0,
|
||||
"proxy_last_available_count": 0,
|
||||
"proxy_source_stats": [],
|
||||
"dependency_alerts": [],
|
||||
"active_job": None,
|
||||
"runs_count": 0,
|
||||
"worker_online": False,
|
||||
}
|
||||
)
|
||||
detect_payload["participating_nodes"] = _build_participating_detect_nodes(
|
||||
cluster_snapshot=cluster_snapshot,
|
||||
detect_snapshot=detect_payload,
|
||||
@@ -351,6 +381,7 @@ def get_runtime_status() -> dict:
|
||||
"mode": worker_runtime.get("mode", runtime_settings.get("worker_mode", "windows-local")),
|
||||
"service_name": runtime_settings.get("worker_service_name", settings.worker_service_name),
|
||||
"running": worker_runtime.get("running", False),
|
||||
"expected_on_this_node": worker_expected_on_this_node,
|
||||
"process_count": worker_runtime.get("process_count", 0),
|
||||
"latest_start_time": worker_runtime.get("latest_start_time", ""),
|
||||
"message": worker_runtime.get("message", ""),
|
||||
|
||||
Reference in New Issue
Block a user