diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/PoolOfflineDataProperties.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/PoolOfflineDataProperties.java index d3728215..ba1be737 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/PoolOfflineDataProperties.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/PoolOfflineDataProperties.java @@ -7,4 +7,5 @@ @Setter public class PoolOfflineDataProperties { private long fixedDelay; + private long initialDelay; } diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java index 46ba529f..3ba50229 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java @@ -49,7 +49,7 @@ public PoolOfflineDataScheduler poolOfflineDataScheduler(PoolOfflineDataStoringS PoolOfflineDataProperties poolOfflineDataProperties() { PoolOfflineDataProperties poolOfflineDataProperties = new PoolOfflineDataProperties(); poolOfflineDataProperties.setFixedDelay(properties.getPoolOfflineData().getFixedDelay()); - + poolOfflineDataProperties.setInitialDelay(properties.getPoolOfflineData().getInitialDelay()); return poolOfflineDataProperties; } diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java index 0b98f6af..9044bcb4 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java @@ -16,6 +16,7 @@ public class SchedulerProperties { @Setter public static final class PoolOfflineData { private long fixedDelay = 172800L; + private long initialDelay = 20000L; } @Getter diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/PoolOfflineDataScheduler.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/PoolOfflineDataScheduler.java index 188be431..23f19385 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/PoolOfflineDataScheduler.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/PoolOfflineDataScheduler.java @@ -23,7 +23,8 @@ public class PoolOfflineDataScheduler { final PoolOfflineDataProperties poolOfflineDataProperties; @Transactional - @Scheduled(fixedDelayString = "#{poolOfflineDataProperties.getFixedDelay() * 1000}") + @Scheduled(initialDelayString = "#{poolOfflineDataProperties.getInitialDelay()}", + fixedDelayString = "#{poolOfflineDataProperties.getFixedDelay() * 1000}") public void fetchPoolOffline() { log.info("-----------Start job fetch pool offline data-----------"); final var startTime = System.currentTimeMillis();