qiuyanjun888 commented on code in PR #18349:
URL: 
https://github.com/apache/dolphinscheduler/pull/18349#discussion_r3418283159


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java:
##########
@@ -418,6 +425,14 @@ private void 
checkUsedEnvironmentWorkerGroupRelation(Set<String> deleteKeySet,
         }
     }
 
+    private Integer getWorkerGroupId(String workerGroupName) {
+        List<WorkerGroup> workerGroups = 
workerGroupDao.queryWorkerGroupByName(workerGroupName);
+        if (CollectionUtils.isEmpty(workerGroups)) {
+            return null;
+        }
+        return workerGroups.get(0).getId();
+    }
+

Review Comment:
   Addressed in 05ef5125df. EnvironmentServiceImpl now parses the worker groups 
once and loads them with workerGroupDao.queryWorkerGroupByNames(...). Missing 
worker groups now throw WORKER_GROUP_NOT_EXIST instead of returning null.



-- 
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]

Reply via email to