wolfboys commented on code in PR #3687:
URL:
https://github.com/apache/incubator-streampark/pull/3687#discussion_r1585158627
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ProjectController.java:
##########
@@ -77,6 +82,16 @@ public RestResponse get(Project project) {
@RequiresPermissions("project:build")
@PermissionScope(team = "#project.teamId")
public RestResponse build(Project project) throws Exception {
+ Long currentBuildCount = projectService.selectCurrentBuildCount();
Review Comment:
Don’t write logic code at the Controller layer, You can move the code in to
the build method of ProjectServiceImpl,
```
ApiAlertException.throwIfTrue(
currentBuildCount > maxProjectBuildNum,
String.format(
"The number of running Build projects exceeds the maximum
number: %d of project max build",
maxProjectBuildNum)
);
```
--
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]