@cryptotaxi247 / netdata-1 / commits / 95a2f1679

Only add comma in api/v1/info if ml-info is going to be printed (#11739)

Emmanuel Vasilakis committed Nov 2, 2021 at 10:15 UTC 95a2f16795be38b26bcddbde24e4d679dfef4427
1 file changed +2 -3
web/api/web_api_v1.c
+2 -3
@@ -1089,19 +1089,18 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb)
1089
1090 buffer_strcat(wb, "\t\"metrics-count\": ");
1091 analytics_get_data(analytics_data.netdata_metrics_count, wb);
1092 - buffer_strcat(wb, ",\n");
1092
1093 #if defined(ENABLE_ML)
1094 + buffer_strcat(wb, ",\n");
1095 char *ml_info = ml_get_host_info(host);
1096
1097 buffer_strcat(wb, "\t\"ml-info\": ");
1098 buffer_strcat(wb, ml_info);
1099 - buffer_strcat(wb, "\n");
1099
1100 free(ml_info);
1101 #endif
1102
1104 - buffer_strcat(wb, "}");
1103 + buffer_strcat(wb, "\n}");
1104 return 0;
1105 }
1106