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 2021/01/21 11:33:39 UTC

[GitHub] [incubator-dolphinscheduler] dailidong commented on a change in pull request #4513: [Improvement][service] Refactor service module to fix code smell

dailidong commented on a change in pull request #4513:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4513#discussion_r561805126



##########
File path: dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
##########
@@ -916,12 +912,10 @@ private String joinGlobalParams(String parentGlobalParams, String subGlobalParam
      */
     private void initTaskInstance(TaskInstance taskInstance) {
 
-        if (!taskInstance.isSubProcess()) {
-            if (taskInstance.getState().typeIsCancel() || taskInstance.getState().typeIsFailure()) {
-                taskInstance.setFlag(Flag.NO);
-                updateTaskInstance(taskInstance);
-                return;
-            }
+        if (!taskInstance.isSubProcess() && taskInstance.getState().typeIsCancel() || taskInstance.getState().typeIsFailure()) {

Review comment:
       this should be changed like this:
      if (!taskInstance.isSubProcess() && (taskInstance.getState().typeIsCancel() || taskInstance.getState().typeIsFailure())) {
   
   how do you think?




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

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