@@ -60,6 +60,7 @@ typedef enum {
6060 STATE_DEL_APP ,
6161 STATE_DEL_DRIVER ,
6262 STATE_ADD_NODE ,
63+ STATE_UPDATE_DEFAULT_APP_TAGS ,
6364 STATE_ADD_GROUP ,
6465 STATE_ADD_TAG ,
6566 STATE_GET_APP_SUBS ,
@@ -745,6 +746,28 @@ static void put_apps_context_next(context_t *ctx, neu_reqresp_type_e type,
745746 }
746747
747748 // After adding nodes, get subscriptions for default apps to unsub
749+ ctx -> idx = 0 ;
750+ ctx -> unsub_idx = 0 ;
751+ ctx -> state = STATE_UPDATE_DEFAULT_APP_TAGS ;
752+ }
753+ // fall through
754+ case STATE_UPDATE_DEFAULT_APP_TAGS : {
755+ neu_resp_error_t * err = data ;
756+ neu_json_apps_req_t * apps = ctx -> apps_req ;
757+
758+ if (ctx -> idx > 0 && 0 != err -> error ) {
759+ ctx -> error = err -> error ;
760+ ctx -> state = STATE_END ;
761+ break ;
762+ }
763+
764+ for (; ctx -> idx < (size_t ) apps -> n_app ; ++ ctx -> idx ) {
765+ neu_json_app_t * app = & apps -> apps [ctx -> idx ];
766+ NEXT (ctx , add_app_tags , app );
767+ ++ ctx -> idx ;
768+ goto done ;
769+ }
770+
748771 ctx -> idx = 0 ;
749772 ctx -> unsub_idx = 0 ;
750773 ctx -> state = STATE_GET_APP_SUBS ;
@@ -1789,12 +1812,12 @@ static int add_app_node(context_t *ctx, neu_json_app_t *app)
17891812
17901813static int add_app_tags (context_t * ctx , neu_json_app_t * app )
17911814{
1792- int ret = 0 ;
17931815 neu_plugin_t * plugin = neu_rest_get_plugin ();
17941816
17951817 neu_reqresp_head_t header = {
1796- .type = NEU_REQ_UPDATE_NODE_TAG ,
1797- .ctx = ctx -> aio ,
1818+ .otel_trace_type = NEU_OTEL_TRACE_TYPE_REST_COMM ,
1819+ .type = NEU_REQ_UPDATE_NODE_TAG ,
1820+ .ctx = ctx -> aio ,
17981821 };
17991822
18001823 neu_req_update_node_tag_t cmd = { 0 };
@@ -1807,7 +1830,7 @@ static int add_app_tags(context_t *ctx, neu_json_app_t *app)
18071830 return NEU_ERR_IS_BUSY ;
18081831 }
18091832
1810- return ret ;
1833+ return 0 ;
18111834}
18121835
18131836static int add_app_setting (context_t * ctx , neu_json_app_t * app )
0 commit comments