rombert commented on a change in pull request #5: SLING-7544 - improving 
optimized alias lookup to not block during int…
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/5#discussion_r185460563
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
 ##########
 @@ -189,10 +199,16 @@ protected void doInit() {
 
             final Map<String, List<MapEntry>> newResolveMapsMap = new 
ConcurrentHashMap<>();
 
+            isAliasMapInitialized = false;
             //optimization made in SLING-2521
             if (this.factory.isOptimizeAliasResolutionEnabled()) {
-                final Map<String, Map<String, String>> aliasMap = 
this.loadAliases(resolver);
-                this.aliasMap = aliasMap;
+               aliasTraversal = new Thread(new Runnable(){
+                               public void run() {
+                                       aliasMap = loadAliases(resolver);
+                                       isAliasMapInitialized = true;
+                                       }
+                               });
+               aliasTraversal.start();
 
 Review comment:
   Ah right. Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to