Skip to content

Commit

Permalink
调整主动通知客户端,停止任务的逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Sep 10, 2024
1 parent f6cb50b commit 8b154e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions connectServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ func connectFScheduleServer(job ClientVO) {
go invokeJob(job, dto.Task)
// 停止任务
case 1:
if jobContext, exists := taskList.Load(dto.Task.Id); exists {
jobContext.(*JobContext).cancel()
flog.Infof("[%s]%d收到Kill请求", job.Name, dto.Task.Id)
if jContext, exists := taskList.Load(dto.Task.Id); exists {
jobContext := jContext.(*JobContext)
jobContext.Remark("FOPS主动停止任务")
jobContext.status = executeStatus.Fail
jobContext.clientJob.report(jobContext)
jobContext.cancel()
flog.Infof("[%s]%d主动停止任务", job.Name, dto.Task.Id)
}
}
}
Expand Down

0 comments on commit 8b154e6

Please sign in to comment.