Browse Source

Merge pull request #571 from lgcareer/branch-1.0.2

fix bug 569 to resolve schedule doesn't really stop
pull/2/head
lgcareer 5 years ago committed by GitHub
parent
commit
e99b5ac6f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java
  2. 8
      escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java

2
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java

@ -487,7 +487,7 @@ public class ProcessDefinitionService extends BaseDAGService {
// set status // set status
schedule.setReleaseState(ReleaseState.OFFLINE); schedule.setReleaseState(ReleaseState.OFFLINE);
scheduleMapper.update(schedule); scheduleMapper.update(schedule);
deleteSchedule(project.getId(), id); deleteSchedule(project.getId(), schedule.getId());
} }
break; break;
} }

8
escheduler-api/src/main/java/cn/escheduler/api/service/SchedulerService.java

@ -442,14 +442,14 @@ public class SchedulerService extends BaseService {
/** /**
* delete schedule * delete schedule
*/ */
public static void deleteSchedule(int projectId, int processId) throws RuntimeException{ public static void deleteSchedule(int projectId, int scheduleId) throws RuntimeException{
logger.info("delete schedules of project id:{}, flow id:{}", projectId, processId); logger.info("delete schedules of project id:{}, schedule id:{}", projectId, scheduleId);
String jobName = QuartzExecutors.buildJobName(processId); String jobName = QuartzExecutors.buildJobName(scheduleId);
String jobGroupName = QuartzExecutors.buildJobGroupName(projectId); String jobGroupName = QuartzExecutors.buildJobGroupName(projectId);
if(!QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName)){ if(!QuartzExecutors.getInstance().deleteJob(jobName, jobGroupName)){
logger.warn("set offline failure:projectId:{},processId:{}",projectId,processId); logger.warn("set offline failure:projectId:{},scheduleId:{}",projectId,scheduleId);
throw new RuntimeException(String.format("set offline failure")); throw new RuntimeException(String.format("set offline failure"));
} }

Loading…
Cancel
Save