diff --git a/Dockerfile b/Dockerfile
index c189e8c..4245dff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM maven:3.9.5-eclipse-temurin-21-alpine AS maven
+FROM maven:3.9.7-eclipse-temurin-21-alpine AS maven
WORKDIR /usr/src/app
COPY . /usr/src/app
diff --git a/pom.xml b/pom.xml
index 7a1996c..654c713 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,7 @@
org.springframework.boot
spring-boot-starter-parent
- 3.2.5
+ 3.3.0
..
@@ -63,23 +63,23 @@
2.0.7
0.12.5
2.12.7
- 2.10.1
+ 2.11.0
2.5.0
- 4.12.2
+ 4.14.0
2.2
- 10.1.23
+ 10.1.24
1.5.6
- 2.17.0
+ 2.17.1
2.9.0
2.5.1
- 1.26.1
+ 1.26.2
- 3.12.1
+ 3.13.0
3.10.0.2594
0.8.12
@@ -89,7 +89,8 @@
java
**/model/**/*.java,
- **/config/SwitcherFeatures.java
+ **/config/SwitcherFeatures.java,
+ **/config/SwitcherConfig.java,
diff --git a/src/main/java/com/github/switcherapi/ac/config/SwitcherConfig.java b/src/main/java/com/github/switcherapi/ac/config/SwitcherConfig.java
index 5f02fd7..f0291aa 100644
--- a/src/main/java/com/github/switcherapi/ac/config/SwitcherConfig.java
+++ b/src/main/java/com/github/switcherapi/ac/config/SwitcherConfig.java
@@ -2,15 +2,19 @@
import com.github.switcherapi.ac.util.FileUtil;
import com.github.switcherapi.client.ContextBuilder;
+import com.github.switcherapi.client.SnapshotCallback;
import jakarta.annotation.PostConstruct;
import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import static com.github.switcherapi.ac.config.SwitcherFeatures.configure;
import static com.github.switcherapi.ac.config.SwitcherFeatures.initializeClient;
+import static com.github.switcherapi.client.SwitcherContextBase.scheduleSnapshotAutoUpdate;
+@Slf4j
@Configuration
@ConfigurationProperties(prefix = "switcher")
@Data
@@ -51,13 +55,19 @@ private void configureSwitcher() {
.component(component)
.local(local)
.silentMode(silent)
- .snapshotAutoUpdateInterval(snapshot.getAutoUpdateInterval())
.snapshotLocation(StringUtils.isNotBlank(snapshot.getLocation()) ? snapshot.getLocation() : null)
.snapshotAutoLoad(snapshot.isAuto())
.truststorePath(StringUtils.isNotBlank(truststore.getPath()) ? FileUtil.getFilePathFromResource(truststore.getPath()) : null)
.truststorePassword(StringUtils.isNotBlank(truststore.getPassword()) ? truststore.getPassword() : null)
);
+ scheduleSnapshotAutoUpdate(snapshot.getAutoUpdateInterval(), new SnapshotCallback() {
+ @Override
+ public void onSnapshotUpdate(long version) {
+ log.info("Snapshot updated: {}", version);
+ }
+ });
+
initializeClient();
}