提交 ac86231d 编写于 作者: 许雪里's avatar 许雪里

任务触发组件优化,常规1s预加载一次,预加载轮空时主动休眠4s,降低加载频率以及对DB压力;

上级 c00a2995
......@@ -194,8 +194,8 @@ public class JobScheduleHelper {
// Wait seconds, align second
if (cost < 1000) { // scan-overtime, not wait
try {
// pre-read success, exist job in 5s, wait 1s;
// pre-read fail, no exist job in 5s, wait 1s
// 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);
} catch (InterruptedException e) {
if (!scheduleThreadToStop) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册