diff --git a/core/core-backend/src/main/java/io/dataease/job/schedule/DeTaskExecutor.java b/core/core-backend/src/main/java/io/dataease/job/schedule/DeTaskExecutor.java index 86c6620eaf..80331d11c7 100644 --- a/core/core-backend/src/main/java/io/dataease/job/schedule/DeTaskExecutor.java +++ b/core/core-backend/src/main/java/io/dataease/job/schedule/DeTaskExecutor.java @@ -51,12 +51,11 @@ public class DeTaskExecutor { public void addRetryTask(Long taskId, Integer retryLimit, Integer retryInterval) { long saltTime = 3000L; - long interval = retryInterval == null ? 0L : retryInterval; + long interval = retryInterval == null ? 5L : retryInterval; long intervalMill = interval * 60000L; long now = System.currentTimeMillis(); - long startTime = now - saltTime + intervalMill; - String cron = "0 */" + retryInterval + " * * * ?"; - long endTime = (retryLimit - 1) * intervalMill + startTime + saltTime; + String cron = "0 */" + interval + " * * * ?"; + long endTime = (retryLimit + 1) * intervalMill + now - saltTime; String key = taskId.toString(); if (CronUtils.taskExpire(endTime)) { return; @@ -68,7 +67,7 @@ public class DeTaskExecutor { jobDataMap.put(IS_RETRY_TASK, true); Date end = null; if (ObjectUtils.isNotEmpty(endTime)) end = new Date(endTime); - scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, new Date(startTime), end, jobDataMap); + scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, new Date(now), end, jobDataMap); } public boolean fireNow(Long taskId) throws Exception { diff --git a/core/core-backend/src/main/java/io/dataease/listener/XpackTaskStarter.java b/core/core-backend/src/main/java/io/dataease/listener/XpackTaskStarter.java index 70a2f022a4..0154a29f6f 100644 --- a/core/core-backend/src/main/java/io/dataease/listener/XpackTaskStarter.java +++ b/core/core-backend/src/main/java/io/dataease/listener/XpackTaskStarter.java @@ -21,7 +21,6 @@ public class XpackTaskStarter implements ApplicationRunner { try { LicenseUtil.validate(); deTaskExecutor.init(); - deTaskExecutor.clearRetryTask(); } catch (Exception e) { LogUtil.error(e.getMessage(), e.getCause()); } diff --git a/de-xpack b/de-xpack index e8581cf0ae..141a8a003f 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit e8581cf0aede767c0ea8fdfbc16058847a8f197b +Subproject commit 141a8a003f3a3eea6a9a5ceae06f15c7b0ecf04e