update document

pull/10/head
xuxueli 6 years ago
parent 19d1ac2ec2
commit b09520b83e

@ -36,13 +36,16 @@ public class JobScheduleHelper {
scheduleThread = new Thread(new Runnable() { scheduleThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
while (!toStop) {
// 随机休眠1s内 try {
try { TimeUnit.MILLISECONDS.sleep(5000);
TimeUnit.MILLISECONDS.sleep(500+new Random().nextInt(500)); } catch (InterruptedException e) {
} catch (InterruptedException e) { if (!toStop) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
} }
}
while (!toStop) {
// 匹配任务 // 匹配任务
Connection conn = null; Connection conn = null;
@ -139,6 +142,16 @@ public class JobScheduleHelper {
} }
} }
} }
// 随机休眠1s内
try {
TimeUnit.MILLISECONDS.sleep(500+new Random().nextInt(500));
} catch (InterruptedException e) {
if (!toStop) {
logger.error(e.getMessage(), e);
}
}
} }
logger.info(">>>>>>>>>>> xxl-job, JobScheduleHelper#scheduleThread stop"); logger.info(">>>>>>>>>>> xxl-job, JobScheduleHelper#scheduleThread stop");
} }
@ -154,6 +167,7 @@ public class JobScheduleHelper {
public void run() { public void run() {
int lastSecond = -1; int lastSecond = -1;
while (!toStop) { while (!toStop) {
try { try {
// second data // second data
List<Integer> ringItemData = new ArrayList<>(); List<Integer> ringItemData = new ArrayList<>();
@ -195,7 +209,9 @@ public class JobScheduleHelper {
try { try {
TimeUnit.SECONDS.sleep(1); TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) { } catch (InterruptedException e) {
logger.error(e.getMessage(), e); if (!toStop) {
logger.error(e.getMessage(), e);
}
} }
} }
logger.info(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread stop"); logger.info(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread stop");

Loading…
Cancel
Save