Skip to content

Commit

Permalink
[Feature](job)support cancel task and fix log invalid
Browse files Browse the repository at this point in the history
Running task can be show and fix cancel fail
  • Loading branch information
CalvinKirs committed Nov 28, 2023
1 parent 8f3c81b commit 7037027
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,14 @@ public void replayDeleteJob(T job) {
.add("msg", "replay delete scheduler job").build());
}

void cancelTask(Long jobId, Long taskId) throws JobException {
checkJobExist(jobId);
if (null == jobMap.get(jobId).getRunningTasks()) {
throw new JobException("task not exist,taskId:" + taskId);
public void cancelTaskById(String jobName, Long taskId) throws JobException {
for (T job : jobMap.values()) {
if (job.getJobName().equals(jobName)) {
job.cancelTaskById(taskId);
return;
}
}
throw new JobException("job not exist,jobName:" + jobName);
}

@Override
Expand Down

0 comments on commit 7037027

Please sign in to comment.