提交 3e0082ce authored 作者: xuxueli's avatar xuxueli

update document

上级 ba3a695a
...@@ -171,7 +171,7 @@ public class JobScheduleHelper { ...@@ -171,7 +171,7 @@ public class JobScheduleHelper {
// align second // align second
try { try {
TimeUnit.MILLISECONDS.sleep(System.currentTimeMillis()%1000 ); TimeUnit.MILLISECONDS.sleep(1000 - System.currentTimeMillis()%1000 );
} catch (InterruptedException e) { } catch (InterruptedException e) {
if (!toStop) { if (!toStop) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
...@@ -181,7 +181,6 @@ public class JobScheduleHelper { ...@@ -181,7 +181,6 @@ public class JobScheduleHelper {
int lastSecond = -1; int lastSecond = -1;
while (!toStop) { while (!toStop) {
long start = System.currentTimeMillis();
try { try {
// second data // second data
List<Integer> ringItemData = new ArrayList<>(); List<Integer> ringItemData = new ArrayList<>();
...@@ -219,11 +218,10 @@ public class JobScheduleHelper { ...@@ -219,11 +218,10 @@ public class JobScheduleHelper {
logger.error(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread error:{}", e); logger.error(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread error:{}", e);
} }
} }
long cost = System.currentTimeMillis() - start;
// next second, align second // next second, align second
try { try {
TimeUnit.MILLISECONDS.sleep(1000-cost); TimeUnit.MILLISECONDS.sleep(1000 - System.currentTimeMillis()%1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
if (!toStop) { if (!toStop) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论