Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions plugins/restful/global_config_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ typedef enum {
STATE_DEL_APP,
STATE_DEL_DRIVER,
STATE_ADD_NODE,
STATE_UPDATE_DEFAULT_APP_TAGS,
STATE_ADD_GROUP,
STATE_ADD_TAG,
STATE_GET_APP_SUBS,
Expand Down Expand Up @@ -745,6 +746,28 @@ static void put_apps_context_next(context_t *ctx, neu_reqresp_type_e type,
}

// After adding nodes, get subscriptions for default apps to unsub
ctx->idx = 0;
ctx->unsub_idx = 0;
ctx->state = STATE_UPDATE_DEFAULT_APP_TAGS;
}
// fall through
case STATE_UPDATE_DEFAULT_APP_TAGS: {
neu_resp_error_t * err = data;
neu_json_apps_req_t *apps = ctx->apps_req;

if (ctx->idx > 0 && 0 != err->error) {
ctx->error = err->error;
ctx->state = STATE_END;
break;
}

for (; ctx->idx < (size_t) apps->n_app; ++ctx->idx) {
neu_json_app_t *app = &apps->apps[ctx->idx];
NEXT(ctx, add_app_tags, app);
++ctx->idx;
goto done;
}

ctx->idx = 0;
ctx->unsub_idx = 0;
ctx->state = STATE_GET_APP_SUBS;
Expand Down Expand Up @@ -1789,12 +1812,12 @@ static int add_app_node(context_t *ctx, neu_json_app_t *app)

static int add_app_tags(context_t *ctx, neu_json_app_t *app)
{
int ret = 0;
neu_plugin_t *plugin = neu_rest_get_plugin();

neu_reqresp_head_t header = {
.type = NEU_REQ_UPDATE_NODE_TAG,
.ctx = ctx->aio,
.otel_trace_type = NEU_OTEL_TRACE_TYPE_REST_COMM,
.type = NEU_REQ_UPDATE_NODE_TAG,
.ctx = ctx->aio,
};

neu_req_update_node_tag_t cmd = { 0 };
Expand All @@ -1807,7 +1830,7 @@ static int add_app_tags(context_t *ctx, neu_json_app_t *app)
return NEU_ERR_IS_BUSY;
}

return ret;
return 0;
}

static int add_app_setting(context_t *ctx, neu_json_app_t *app)
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.0-beta2
2.14.0-beta3