diff --git a/src/main/java/org/entur/lamassu/leader/entityupdater/StationsUpdater.java b/src/main/java/org/entur/lamassu/leader/entityupdater/StationsUpdater.java index e77dc720..f63a2f6b 100644 --- a/src/main/java/org/entur/lamassu/leader/entityupdater/StationsUpdater.java +++ b/src/main/java/org/entur/lamassu/leader/entityupdater/StationsUpdater.java @@ -50,6 +50,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component @@ -64,6 +65,12 @@ public class StationsUpdater { private final MetricsService metricsService; + @Value("${org.entur.lamassu.stationEntityCacheMinimumTtl:30}") + private Integer stationEntityCacheMinimumTtl; + + @Value("${org.entur.lamassu.stationEntityCacheMaximumTtl:300}") + private Integer stationEntityCacheMaximumTtl; + @Autowired public StationsUpdater( StationCache stationCache, @@ -223,7 +230,8 @@ public void addOrUpdateStations( (int) Instant.now().getEpochSecond(), (int) lastUpdated.getTime() / 1000, ttl, - 300 + stationEntityCacheMinimumTtl, + stationEntityCacheMaximumTtl ), TimeUnit.SECONDS );