From 7d31e9838af6c4bdd054be9bb7066fc88b430be8 Mon Sep 17 00:00:00 2001 From: "xueli.xue" Date: Sun, 12 Mar 2017 18:34:56 +0800 Subject: [PATCH] fix --- .../admin/service/impl/XxlJobServiceImpl.java | 24 +++++++++---------- .../main/webapp/static/js/joblog.index.1.js | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index b9a337be..f86a1329 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -168,6 +168,7 @@ public class XxlJobServiceImpl implements IXxlJobService { // stage job info XxlJobInfo exists_jobInfo = xxlJobInfoDao.loadById(jobInfo.getId()); + String old_cron = exists_jobInfo.getJobCron(); if (exists_jobInfo == null) { return new ReturnT(500, "参数异常"); } @@ -181,19 +182,16 @@ public class XxlJobServiceImpl implements IXxlJobService { exists_jobInfo.setExecutorParam(jobInfo.getExecutorParam()); exists_jobInfo.setGlueSwitch(jobInfo.getGlueSwitch()); exists_jobInfo.setChildJobKey(jobInfo.getChildJobKey()); - - try { - // fresh quartz - boolean ret = XxlJobDynamicScheduler.rescheduleJob(String.valueOf(exists_jobInfo.getJobGroup()), String.valueOf(exists_jobInfo.getId()), exists_jobInfo.getJobCron()); - if (ret) { - xxlJobInfoDao.update(exists_jobInfo); - return ReturnT.SUCCESS; - } else { - return new ReturnT(500, "更新任务失败"); - } - } catch (SchedulerException e) { - logger.error("", e); - } + xxlJobInfoDao.update(exists_jobInfo); + + try { + // fresh quartz + boolean ret = XxlJobDynamicScheduler.rescheduleJob(String.valueOf(exists_jobInfo.getJobGroup()), String.valueOf(exists_jobInfo.getId()), exists_jobInfo.getJobCron()); + return ret?ReturnT.SUCCESS:ReturnT.FAIL; + } catch (SchedulerException e) { + logger.error("", e); + } + return ReturnT.FAIL; } diff --git a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js index 830c2fd9..eb121348 100644 --- a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js +++ b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js @@ -11,7 +11,7 @@ $(function() { dataType : "json", success : function(data){ if (data.code == 200) { - $("#jobId").html(''); + $("#jobId").html(''); $.each(data.content, function (n, value) { $("#jobId").append(''); });