From df7080e3f527283f045bbbd2fa18598d0dc45a81 Mon Sep 17 00:00:00 2001 From: hxy7yx <1595670487@qq.com> Date: Tue, 25 Feb 2025 00:45:17 -0800 Subject: [PATCH] fix monitor --- plugins/monitor/monitor.json | 4 ++-- plugins/restful/adapter_handle.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/monitor/monitor.json b/plugins/monitor/monitor.json index 7b589961..3aded419 100644 --- a/plugins/monitor/monitor.json +++ b/plugins/monitor/monitor.json @@ -18,7 +18,7 @@ "description_zh": "事件消息发布的主题前缀", "type": "string", "attribute": "required", - "default": "/neuron/{client-id}", + "default": "/neuron/monitor/${random_str}", "valid": { "length": 255 } @@ -42,7 +42,7 @@ "description_zh": "心跳消息发布的主题", "type": "string", "attribute": "required", - "default": "/neuron/${node-name}/heartbeat", + "default": "/neuron/heartbeat/${random_str}", "valid": { "length": 255 } diff --git a/plugins/restful/adapter_handle.c b/plugins/restful/adapter_handle.c index d3e5e4ff..14b23c25 100644 --- a/plugins/restful/adapter_handle.c +++ b/plugins/restful/adapter_handle.c @@ -86,7 +86,8 @@ static inline int send_node_update_req(nng_aio * aio, return NEU_ERR_NODE_NAME_EMPTY; } - if (strcmp(req->new_name, "monitor") == 0) { + if (strcmp(req->new_name, "monitor") == 0 || + strcmp(req->name, "monitor") == 0) { return NEU_ERR_NODE_NOT_ALLOW_UPDATE; }