caishunfeng commented on code in PR #10586:
URL: https://github.com/apache/dolphinscheduler/pull/10586#discussion_r905678667


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java:
##########
@@ -1115,6 +1115,12 @@ private TaskInstance findTaskIfExists(Long taskCode, int 
taskVersion) {
     private TaskInstance createTaskInstance(ProcessInstance processInstance, 
TaskNode taskNode) {
         TaskInstance taskInstance = findTaskIfExists(taskNode.getCode(), 
taskNode.getVersion());
         if (taskInstance != null) {
+            if (!taskInstance.getEnvironmentCode().equals(-1L)) {
+                Environment environment = 
processService.findEnvironmentByCode(taskInstance.getEnvironmentCode());

Review Comment:
   I think we should not query again after workflow running, and I found that 
there was already in `WorkflowExecuteRunnable.newTaskInstance`.
   
   



##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteRunnable.java:
##########
@@ -1115,6 +1115,12 @@ private TaskInstance findTaskIfExists(Long taskCode, int 
taskVersion) {
     private TaskInstance createTaskInstance(ProcessInstance processInstance, 
TaskNode taskNode) {
         TaskInstance taskInstance = findTaskIfExists(taskNode.getCode(), 
taskNode.getVersion());
         if (taskInstance != null) {
+            if (!taskInstance.getEnvironmentCode().equals(-1L)) {

Review Comment:
   ```suggestion
               if 
(!taskInstance.getEnvironmentCode().equals(Constants.DEFAULT_ENVIRONMENT_CODE)) 
{
   ```



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