Browse Source

fix bug: tolerance task need not to check retry times

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

4
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
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);

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

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

Loading…
Cancel
Save