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/12/22 11:17:02 UTC

[GitHub] [dolphinscheduler] calvinjiang commented on a diff in pull request #13261: [Fix-13260][API] Ironed out the issue with lacking the value of user's name when querying the list of workflow definitions.

calvinjiang commented on code in PR #13261:
URL: https://github.com/apache/dolphinscheduler/pull/13261#discussion_r1055356054


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -597,8 +597,10 @@ public PageInfo<ProcessDefinition> queryProcessDefinitionListPaging(@NonNull Use
             // todo: use batch query
             ProcessDefinitionLog processDefinitionLog =
                     processDefinitionLogMapper.queryByDefinitionCodeAndVersion(pd.getCode(), pd.getVersion());
-            User user = userMapper.selectById(processDefinitionLog.getOperator());
-            pd.setModifyBy(user.getUserName());
+            User modifiedUser = userMapper.selectById(processDefinitionLog.getOperator());
+            pd.setModifyBy(modifiedUser.getUserName());
+            User createUser = userMapper.selectById(processDefinitionLog.getUserId());

Review Comment:
   Sure. It definitely increase the load on the database. I'll adjust the way to query users.



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java:
##########
@@ -597,8 +597,10 @@ public PageInfo<ProcessDefinition> queryProcessDefinitionListPaging(@NonNull Use
             // todo: use batch query
             ProcessDefinitionLog processDefinitionLog =
                     processDefinitionLogMapper.queryByDefinitionCodeAndVersion(pd.getCode(), pd.getVersion());
-            User user = userMapper.selectById(processDefinitionLog.getOperator());
-            pd.setModifyBy(user.getUserName());
+            User modifiedUser = userMapper.selectById(processDefinitionLog.getOperator());
+            pd.setModifyBy(modifiedUser.getUserName());
+            User createUser = userMapper.selectById(processDefinitionLog.getUserId());

Review Comment:
   Sure. It definitely increases the load on the database. I'll adjust the way to query users.



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