From 960b8d5f5ab5ad08fd8536c44ece675ecf4fa0ac Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 6 Jun 2018 22:09:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8A=A5=E8=A1=A8=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E3=80=81=E5=A4=B1=E8=B4=A5=E5=92=8C=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=E7=BB=9F=E8=AE=A1=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../xxl/job/admin/core/thread/JobFailMonitorHelper.java | 9 +++++---- .../main/resources/mybatis-mapper/XxlJobLogMapper.xml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 09992d44..0fededb4 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1217,6 +1217,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 12、脚本任务异常Log输出优化; - 13、任务线程停止变量修饰符优化; - 14、脚本任务Log文件流关闭优化; +- 15、任务报表成功、失败和进行中统计问题修复; ### TODO LIST diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java index 66a77346..0d5ab6e3 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java @@ -56,21 +56,22 @@ public class JobFailMonitorHelper { continue; } if (IJobHandler.SUCCESS.getCode() == log.getTriggerCode() && log.getHandleCode() == 0) { + // job running JobFailMonitorHelper.monitor(jobLogId); logger.info(">>>>>>>>>>> job monitor, job running, JobLogId:{}", jobLogId); } else if (IJobHandler.SUCCESS.getCode() == log.getHandleCode()) { // job success, pass logger.info(">>>>>>>>>>> job monitor, job success, JobLogId:{}", jobLogId); - } else if (IJobHandler.FAIL.getCode() == log.getTriggerCode() + } else /*if (IJobHandler.FAIL.getCode() == log.getTriggerCode() || IJobHandler.FAIL.getCode() == log.getHandleCode() - || IJobHandler.FAIL_RETRY.getCode() == log.getHandleCode() ) { + || IJobHandler.FAIL_RETRY.getCode() == log.getHandleCode() )*/ { // job fail, failAlarm(log); logger.info(">>>>>>>>>>> job monitor, job fail, JobLogId:{}", jobLogId); - } else { + }/* else { JobFailMonitorHelper.monitor(jobLogId); logger.info(">>>>>>>>>>> job monitor, job status unknown, JobLogId:{}", jobLogId); - } + }*/ } } diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml index 9c512a00..e125ac22 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml @@ -172,7 +172,7 @@ SELECT DATE_FORMAT(trigger_time,'%Y-%m-%d') triggerDay, COUNT(handle_code) triggerDayCount, - SUM(CASE WHEN handle_code = 0 then 1 else 0 end) as triggerDayCountRunning, + SUM(CASE WHEN (trigger_code = 200 and handle_code = 0) then 1 else 0 end) as triggerDayCountRunning, SUM(CASE WHEN handle_code = 200 then 1 else 0 end) as triggerDayCountSuc FROM XXL_JOB_QRTZ_TRIGGER_LOG WHERE trigger_time BETWEEN #{from} and #{to}