Skip to content

Commit

Permalink
to #9801: fix delete job of quartz not work (#10645)
Browse files Browse the repository at this point in the history
Co-authored-by: 宏豁 <honghuo.zw@alibaba-inc.com>
  • Loading branch information
zwZjut and 宏豁 authored Jul 1, 2022
1 parent ab046da commit 85d3637
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,11 @@ public void deleteSchedule(int projectId, int scheduleId) {

String jobName = QuartzExecutors.buildJobName(scheduleId);
String jobGroupName = QuartzExecutors.buildJobGroupName(projectId);

JobKey jobKey = new JobKey(jobName, jobGroupName);
try {
if (scheduler.checkExists(jobKey)) {
logger.info("Try to delete job: {}, group name: {},", jobName, jobGroupName);
scheduler.deleteJob(jobKey);
}
} catch (SchedulerException e) {
logger.error("Failed to delete job: {}", jobKey);
throw new ServiceException("Failed to delete job: " + jobKey);
boolean result = QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName);
if (!result) {
throw new ServiceException(String.format("Failed to delete job, jobName:%s, jobGroupName:%s", jobName, jobGroupName));
}
logger.info("delete job success, job name: {}, job group name: {},", jobName, jobGroupName);
}

/**
Expand Down

0 comments on commit 85d3637

Please sign in to comment.