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 d508b1f9..831bcf6a 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 @@ -222,17 +222,17 @@ public class JobScheduleHelper { @Override public void run() { - // align second - try { - TimeUnit.MILLISECONDS.sleep(1000 - System.currentTimeMillis()%1000 ); - } catch (InterruptedException e) { - if (!ringThreadToStop) { - logger.error(e.getMessage(), e); - } - } - while (!ringThreadToStop) { + // align second + try { + TimeUnit.MILLISECONDS.sleep(1000 - System.currentTimeMillis() % 1000); + } catch (InterruptedException e) { + if (!ringThreadToStop) { + logger.error(e.getMessage(), e); + } + } + try { // second data List ringItemData = new ArrayList<>(); @@ -260,15 +260,6 @@ public class JobScheduleHelper { logger.error(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread error:{}", e); } } - - // next second, align second - try { - TimeUnit.MILLISECONDS.sleep(1000 - System.currentTimeMillis()%1000); - } catch (InterruptedException e) { - if (!ringThreadToStop) { - logger.error(e.getMessage(), e); - } - } } logger.info(">>>>>>>>>>> xxl-job, JobScheduleHelper#ringThread stop"); }