Commit 8f72c9c2 by Nepxion

Guava缓存换成Caffeine缓存

parent 934e2179
......@@ -22,7 +22,7 @@ public class PluginCache {
public PluginCache() {
loadingCache = Caffeine.newBuilder()
.expireAfterWrite(365 * 10, TimeUnit.DAYS)
.expireAfterWrite(365 * 100, TimeUnit.DAYS)
.initialCapacity(10)
.maximumSize(100)
.recordStats()
......@@ -41,7 +41,11 @@ public class PluginCache {
}
public String get(String key) {
return loadingCache.get(key);
try {
return loadingCache.get(key);
} catch (Exception e) {
return StringUtils.EMPTY;
}
}
public boolean clear(String key) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment