fataOT commented on code in PR #1230:
URL: https://github.com/apache/tomee/pull/1230#discussion_r1663716048


##########
tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java:
##########
@@ -122,7 +122,13 @@ public void processApplication(@Observes final 
BeforeEvent<AfterApplicationCreat
         // index only once and pass it everywhere it's needed. Also in order 
to build the index, we need the entire
         // application so doing it here from the AppInfo is way simpler
         try {
-            final Index index = 
of(afterApplicationCreated.getEvent().getApp().libs);
+            final Index index;
+            
if(indexCache.containsKey(afterApplicationCreated.getEvent().getApp())) {
+                index = 
indexCache.get(afterApplicationCreated.getEvent().getApp());
+            } else {
+                index = of(afterApplicationCreated.getEvent().getApp().libs);
+                indexCache.put(afterApplicationCreated.getEvent().getApp(), 
index);

Review Comment:
   I followed another approach. The AppInfo knows all webApps that need to be 
deployed.
   I will remove the cache entry, if the last webApp for the given AppInfo has 
been deployed.
   
   As suggested, I also listen for the AssemblerBeforeApplicationDestroyed 
event and will remove the corresponding cache entry, if it still exists



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to