ruanwenjun commented on code in PR #11424:
URL: https://github.com/apache/dolphinscheduler/pull/11424#discussion_r944094962


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DependentExecute.java:
##########
@@ -187,12 +187,6 @@ private DependResult getDependTaskResult(long taskCode, 
ProcessInstance processI
      */
     private ProcessInstance findLastProcessInterval(Long definitionCode, 
DateInterval dateInterval) {
 
-        ProcessInstance runningProcess = 
processService.findLastRunningProcess(definitionCode,
-                dateInterval.getStartTime(), dateInterval.getEndTime());
-        if (runningProcess != null) {
-            return runningProcess;
-        }
-

Review Comment:
   AFAIK, this method is just want to find the latest `processInstance` by 
`endTime` or `scheduleTime`.
   ```
   find the last one process instance that :
        * 1. manual run and finish between the interval
        * 2. schedule run and schedule time between the interval
        private ProcessInstance findLastProcessInterval(Long definitionCode, 
DateInterval dateInterval)
   ```
   It doesn't care about the before processInstance.
   
   For example: 
   If I have a process instance manual executed 5 times today, and I use this 
method to query today process instance.
   ```
   11:00 finished
   10:00 finished
   9:00 running
   8:00 finished
   7:00 finished
   ```
   This method should return the latest processInstance(11:00), not 9:00.
   



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