Arthur Bogaart pushed to branch release/5.2 at cms-community / 
hippo-addon-channel-manager


Commits:
06bfa682 by Arthur Bogaart at 2018-03-23T16:27:48+01:00
CHANNELMGR-1778 Use documentType + locale as cacheKey for documentTypes

(cherry picked from commit 034302343c07d9964504624e3cfef1330a1c8e88)

- - - - -


1 changed file:

- 
content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/DocumentTypesServiceImpl.java


Changes:

=====================================
content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/DocumentTypesServiceImpl.java
=====================================
--- 
a/content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/DocumentTypesServiceImpl.java
+++ 
b/content-service/src/main/java/org/onehippo/cms/channelmanager/content/documenttype/DocumentTypesServiceImpl.java
@@ -52,8 +52,10 @@ class DocumentTypesServiceImpl implements 
DocumentTypesService {
     @Override
     public DocumentType getDocumentType(final String id, final Session 
userSession, final Locale locale)
             throws ErrorWithPayloadException {
+
+        final String cacheKey = id + "-" + locale.toString();
         try {
-            return DOCUMENT_TYPES.get(id, () -> createDocumentType(id, 
userSession, locale));
+            return DOCUMENT_TYPES.get(cacheKey, () -> createDocumentType(id, 
userSession, locale));
         } catch (final ExecutionException ignore) {
             throw new NotFoundException();
         }



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/06bfa68230419cb1f3a785221c0c715820f4c5d1

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/06bfa68230419cb1f3a785221c0c715820f4c5d1
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to