diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java index 95a4164a..80556f07 100644 --- a/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java +++ b/src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java @@ -1166,8 +1166,10 @@ protected void initializeVanityPaths() throws IOException { this.initializing.lock(); try { if (this.factory.isVanityPathEnabled()) { + vanityPathsProcessed.set(false); this.vanityBloomFilter = createVanityBloomFilter(); VanityPathInitializer vpi = new VanityPathInitializer(this.factory); + if (this.factory.isVanityPathCacheInitInBackground()) { this.log.debug("bg init starting"); Thread vpinit = new Thread(vpi, "VanityPathInitializer"); diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathMapEntriesTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathMapEntriesTest.java index 066c2912..d0da9dfc 100644 --- a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathMapEntriesTest.java +++ b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathMapEntriesTest.java @@ -181,7 +181,6 @@ private void waitForBgInit() { // get vanity paths (after waiting for bg init to complete) private void initializeVanityPaths() throws IOException { - getVanityPathsProcessed().set(false); mapEntries.initializeVanityPaths(); waitForBgInit(); }