You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/18 02:59:50 UTC

[GitHub] [dolphinscheduler] longtb976 commented on a diff in pull request #11522: [Improvement][TaskInstance] reduce database queries

longtb976 commented on code in PR #11522:
URL: https://github.com/apache/dolphinscheduler/pull/11522#discussion_r948606243


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -1730,8 +1736,14 @@ public Map<String, Object> viewTree(User loginUser, long projectCode, long code,
                 // set treeViewDto instances
                 for (int i = limit - 1; i >= 0; i--) {
                     ProcessInstance processInstance = processInstanceList.get(i);
-                    TaskInstance taskInstance = taskInstanceMapper.queryByInstanceIdAndCode(processInstance.getId(),
-                            Long.parseLong(nodeCode));
+                    TaskInstance taskInstance = null;

Review Comment:
   For ends the loop early without going through every element



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org