Skip to content

Commit

Permalink
Forcing updated data during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
lassetyr committed Mar 11, 2024
1 parent c77908f commit 8026d50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/no/rutebanken/anshar/data/SiriRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ protected void enableCache(IMap<SiriObjectStorageKey, T> map) {

protected void enableCache(IMap<SiriObjectStorageKey, T> map, java.util.function.Predicate<T> includeInCachePredicate) {

// Looping through all keys to sync metadata before startup
int sizeBefore = map.localKeySet().size();
int counter = 0;
for (SiriObjectStorageKey key : map.keySet()) {
counter++;
}
int sizeAfter = map.localKeySet().size();
logger.info("Instance started with {} keys (localKeySet.size: before {}, after {})", counter, sizeBefore, sizeAfter);

// Entry added - new data
map.addEntryListener((EntryAddedListener<SiriObjectStorageKey, T>) entryEvent -> {

Expand Down

0 comments on commit 8026d50

Please sign in to comment.