diff --git a/dotCMS/src/main/java/com/dotmarketing/business/cache/provider/caffine/CaffineCache.java b/dotCMS/src/main/java/com/dotmarketing/business/cache/provider/caffine/CaffineCache.java index fe149aaec3b2..d3734a57664e 100644 --- a/dotCMS/src/main/java/com/dotmarketing/business/cache/provider/caffine/CaffineCache.java +++ b/dotCMS/src/main/java/com/dotmarketing/business/cache/provider/caffine/CaffineCache.java @@ -31,6 +31,7 @@ * i.e., for the "graphqlquerycache" group *
* cache.graphqlquerycache.chain=com.dotmarketing.business.cache.provider.caffine.CaffineCache
+ * cache.graphqlquerycache.size=10000
* cache.graphqlquerycache.seconds=15
*/
public class CaffineCache extends CacheProvider {
@@ -59,7 +60,9 @@ public boolean isDistributed() {
@Override
public void init() {
- isInitialized.compareAndSet(false, doInit());
+ if(!isInitialized.getAndSet(true)){
+ doInit();
+ };
}
private boolean doInit() {
@@ -116,8 +119,7 @@ public Object get(String group, String key) {
if (group == null || key == null) {
return null;
}
- DynamicTTLCache cache = getCache(group);
- return cache.getIfPresent(key.toLowerCase());
+ return getCache(group).getIfPresent(key.toLowerCase());
}
@@ -128,15 +130,14 @@ public void remove(String group, String key) {
return;
}
- DynamicTTLCache