gosonzhang commented on code in PR #8702:
URL: https://github.com/apache/inlong/pull/8702#discussion_r1293081221
##########
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/handler/WebBrokerConfHandler.java:
##########
@@ -1055,9 +1057,14 @@ private StringBuilder
buildRetInfo(List<BrokerProcessResult> retInfo,
.append("\",\"success\":").append(entry.isSuccess())
.append(",\"errCode\":").append(entry.getErrCode())
.append(",\"errInfo\":\"").append(entry.getErrMsg()).append("\"}");
+ if (isSucceed && !entry.isSuccess()) {
+ isSucceed = false;
+ errInfo = entry.getErrMsg();
+ errCode = entry.getErrCode();
+ }
}
- WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, totalCnt);
- return sBuffer;
+ return WebParameterUtils.buildSuccessOrFailRet(sBuffer, totalCnt,
isSucceed, errCode,
Review Comment:
This place introduces bugs, and after this modification, the code will be
more error-prone to maintain
TubeMQ's http api access is relatively frequent. Based on this, it
prioritizes performance loss over readability.
This PR modification, the initial submitted changes are more readable, but
it introduces additional resource consumption, it is best to achieve better
readability with the least performance loss.
@liaosunny123
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]