Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #101 add initial delay for pool offline data job #103

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 20000L;
}

@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
Loading