Browse Source

fix bug: tolerance task need not to check retry times

pull/2/head
baoliang 6 years ago
parent
commit
0bf8e270a6
  1. 6
      escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java
  2. 6
      escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java

6
escheduler-dao/src/main/java/cn/escheduler/dao/ProcessDao.java

@ -923,7 +923,11 @@ public class ProcessDao extends AbstractBaseDao {
taskInstance.setFlag(Flag.NO);
updateTaskInstance(taskInstance);
// crate new task instance
taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1 );
if(taskInstance.getState() != ExecutionStatus.NEED_FAULT_TOLERANCE){
taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1 );
}
taskInstance.setEndTime(null);
taskInstance.setStartTime(new Date());
taskInstance.setFlag(Flag.YES);
taskInstance.setHost(null);
taskInstance.setId(0);

6
escheduler-dao/src/main/java/cn/escheduler/dao/model/TaskInstance.java

@ -422,8 +422,12 @@ public class TaskInstance {
if(this.isSubProcess()){
return false;
}
return (this.getState().typeIsFailure()
if(this.getState() == ExecutionStatus.NEED_FAULT_TOLERANCE){
return true;
}else {
return (this.getState().typeIsFailure()
&& this.getRetryTimes() < this.getMaxRetryTimes());
}
}
public void setDependency(String dependency) {

Loading…
Cancel
Save