summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2021-11-02 10:15:22 +0200
committerGitHub <noreply@github.com>2021-11-02 10:15:22 +0200
commit95a2f16795be38b26bcddbde24e4d679dfef4427 (patch)
tree1e31a60d35b01e7fb1cc76b24368176a3420cda2 /web
parent8b24eb3ede3f4327d98376387b5e174dbe0d24f2 (diff)
Only add comma in api/v1/info if ml-info is going to be printed (#11739)
Diffstat (limited to 'web')
-rw-r--r--web/api/web_api_v1.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index 76e107b142..d335dd687d 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -1089,19 +1089,18 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb)
buffer_strcat(wb, "\t\"metrics-count\": ");
analytics_get_data(analytics_data.netdata_metrics_count, wb);
- buffer_strcat(wb, ",\n");
#if defined(ENABLE_ML)
+ buffer_strcat(wb, ",\n");
char *ml_info = ml_get_host_info(host);
buffer_strcat(wb, "\t\"ml-info\": ");
buffer_strcat(wb, ml_info);
- buffer_strcat(wb, "\n");
free(ml_info);
#endif
- buffer_strcat(wb, "}");
+ buffer_strcat(wb, "\n}");
return 0;
}