Browse Source

to #9801: fix delete job of quartz not work (#10645)

Co-authored-by: 宏豁 <honghuo.zw@alibaba-inc.com>
2.0.7-release
zwZjut 2 years ago committed by GitHub
parent
commit
85d3637f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

14
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java

@ -459,17 +459,11 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
String jobName = QuartzExecutors.buildJobName(scheduleId); String jobName = QuartzExecutors.buildJobName(scheduleId);
String jobGroupName = QuartzExecutors.buildJobGroupName(projectId); String jobGroupName = QuartzExecutors.buildJobGroupName(projectId);
boolean result = QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName);
JobKey jobKey = new JobKey(jobName, jobGroupName); if (!result) {
try { throw new ServiceException(String.format("Failed to delete job, jobName:%s, jobGroupName:%s", jobName, jobGroupName));
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);
} }
logger.info("delete job success, job name: {}, job group name: {},", jobName, jobGroupName);
} }
/** /**

Loading…
Cancel
Save