[Improvement-14280][Task] update the task execution status check (#14281)

This commit is contained in:
Rick Cheng 2023-06-06 15:25:57 +08:00 committed by GitHub
parent d587b5f03d
commit 4d798e774e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 11 deletions

View File

@ -39,12 +39,6 @@ public enum TaskExecutionStatus {
;
private static final Map<Integer, TaskExecutionStatus> CODE_MAP = new HashMap<>();
private static final int[] NEED_FAILOVER_STATES = new int[]{
SUBMITTED_SUCCESS.getCode(),
DISPATCH.getCode(),
RUNNING_EXECUTION.getCode(),
DELAY_EXECUTION.getCode(),
};
static {
for (TaskExecutionStatus executionStatus : TaskExecutionStatus.values()) {
@ -93,17 +87,13 @@ public enum TaskExecutionStatus {
}
public boolean isFinished() {
return isSuccess() || isKill() || isFailure() || isPause() || isStop();
return isSuccess() || isKill() || isFailure() || isPause() || isStop() || isForceSuccess();
}
public boolean isNeedFaultTolerance() {
return this == NEED_FAULT_TOLERANCE;
}
public static int[] getNeedFailoverWorkflowInstanceState() {
return NEED_FAILOVER_STATES;
}
public boolean shouldFailover() {
return SUBMITTED_SUCCESS == this
|| DISPATCH == this