Skip to content

Commit

Permalink
bugfix: 作业强制终止后,”重试并继续“,“跳过”功能不可用 TencentBlueKing#1206
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 authored and jsonwan committed Aug 26, 2022
1 parent 6525bf1 commit 9c742f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ private void stopStep(StepInstanceDTO stepInstance) {
stepInstance.getTotalTime()));
taskExecuteMQEventDispatcher.dispatchJobEvent(JobEvent.refreshJob(stepInstance.getTaskInstanceId(),
EventSource.buildStepEventSource(stepInstanceId)));
} else {
// 正在运行中的任务无法立即结束,需要等待任务调度引擎检测到停止状态
} else if (stepStatus == RunStatusEnum.RUNNING) {
// 正在运行中的任务无法立即结束,需要等待任务调度引擎检测到停止状态;这里只需要处理设置步骤状态即可
taskInstanceService.updateStepStatus(stepInstanceId, RunStatusEnum.STOPPING.getValue());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ private void stopJob(TaskInstanceDTO taskInstance) {
long jobInstanceId = taskInstance.getId();
RunStatusEnum taskStatus = taskInstance.getStatus();

if (RunStatusEnum.RUNNING == taskStatus) {
taskInstanceService.updateTaskStatus(jobInstanceId, RunStatusEnum.STOPPING.getValue());
} else if (RunStatusEnum.WAITING_USER == taskStatus) {
if (RunStatusEnum.RUNNING == taskStatus || RunStatusEnum.WAITING_USER == taskStatus) {
taskInstanceService.updateTaskStatus(jobInstanceId, RunStatusEnum.STOPPING.getValue());
long currentStepInstanceId = taskInstance.getCurrentStepInstanceId();
taskExecuteMQEventDispatcher.dispatchStepEvent(StepEvent.stopStep(currentStepInstanceId));
Expand Down

0 comments on commit 9c742f3

Please sign in to comment.