Skip to content

Commit

Permalink
feat: #101 add initial delay for pool offline data job
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-HuyLe3a committed Dec 7, 2023
1 parent 9fef864 commit 760b7e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
@Setter
public class PoolOfflineDataProperties {
private long fixedDelay;
private long initialDelay;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class SchedulerProperties {
@Setter
public static final class PoolOfflineData {
private long fixedDelay = 172800L;
private long initialDelay = 30000L;
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 760b7e5

Please sign in to comment.