From 4dd19ac5184c620c778042fc6e884fc085ef157f Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 19 Jul 2019 11:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=A7=A6=E5=8F=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BC=98=E5=8C=96=EF=BC=8C=E9=A2=84=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E9=A2=91=E7=8E=87=E6=AD=A3=E5=B8=B81s=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E9=A2=84=E5=8A=A0=E8=BD=BD=E8=BD=AE=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E4=B8=BB=E5=8A=A8=E4=BC=91=E7=9C=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=91=A8=E6=9C=9F=EF=BC=8C=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=99=8D=E4=BD=8E=E5=8A=A0=E8=BD=BD=E9=A2=91=E7=8E=87=E4=BB=8E?= =?UTF-8?q?=E8=80=8C=E9=99=8D=E4=BD=8EDB=E5=8E=8B=E5=8A=9B=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 2 +- .../com/xxl/job/admin/core/thread/JobScheduleHelper.java | 5 ++--- .../src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 12b98239..52eec775 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1517,7 +1517,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 6、登录界面取消默认填写的登录账号密码; - 7、[ING]cron在线生成工具; - 8、[ING]任务、执行器数据全量本地缓存;新增消息表广播通知; -- 9、任务触发组件优化,常规1s预加载一次,预加载轮空时主动休眠4s,降低加载频率以及对DB压力; +- 9、任务触发组件优化,预加载频率正常1s一次,当预加载轮空时主动休眠一个加载周期,动态降低加载频率从而降低DB压力; - 10、注册监控线程优化,降低死锁几率; - 11、调度组件优化:针对永远不会触发的Cron禁止配置和启动;任务Cron最后一次触发后再也不会触发时,比如一次性任务,主动停止相关任务; - 12、任务列表交互优化,支持查看任务所属执行器的注册节点; diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java index bc1e82ba..d3c51b82 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java @@ -194,9 +194,8 @@ public class JobScheduleHelper { // Wait seconds, align second if (cost < 1000) { // scan-overtime, not wait try { - // pre-read success, exist job in pre-read period, wait 1s; - // pre-read fail, no exist job in pre-read period, wait 4s - TimeUnit.MILLISECONDS.sleep((preReadSuc?1000:4000) - System.currentTimeMillis()%1000); + // pre-read period: success > scan each second; fail > skip this period; + TimeUnit.MILLISECONDS.sleep((preReadSuc?1000:PRE_READ_MS) - System.currentTimeMillis()%1000); } catch (InterruptedException e) { if (!scheduleThreadToStop) { logger.error(e.getMessage(), e); diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml index 46286fc5..0407011a 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml @@ -212,7 +212,7 @@ SELECT FROM xxl_job_info AS t WHERE t.trigger_status = 1 - and t.trigger_next_time #{maxNextTime} + and t.trigger_next_time #{maxNextTime}