Closed oliviarla closed 2 months ago
@oliviarla
아래 코드에 있는 config 객체 생성 방식도 참고 바랍니다.
public LocalCacheManager(String name, int max, int exptime, boolean copyOnRead,
boolean copyOnWrite) {
this.cache = CacheManager.getInstance().getCache(name);
if (cache == null) {
CacheConfiguration config =
new CacheConfiguration(name, max)
.copyOnRead(copyOnRead)
.copyOnWrite(copyOnWrite)
.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU)
.eternal(false)
.timeToLiveSeconds(exptime)
.timeToIdleSeconds(exptime)
.diskExpiryThreadIntervalSeconds(60)
.persistence(new PersistenceConfiguration().strategy(
PersistenceConfiguration.Strategy.NONE));
this.cache = new Cache(config, null, null);
CacheManager.getInstance().addCache(cache);
logger.info("Arcus k/v local cache is enabled : %s", cache.toString());
}
}
🔗 Related Issue
⌨️ What I did