feat:模块名称调整
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.tiesheng.util;
|
||||
|
||||
import cn.hutool.cache.CacheUtil;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
|
||||
public class TimedCacheHelper {
|
||||
|
||||
private static volatile TimedCache<String, String> timedCache;
|
||||
|
||||
/**
|
||||
* 获取一个默认2分钟过期的缓存
|
||||
*/
|
||||
public static TimedCache<String, String> getTimedCache() {
|
||||
if (timedCache == null) {
|
||||
synchronized (TimedCacheHelper.class) {
|
||||
if (timedCache == null) {
|
||||
timedCache = CacheUtil.newTimedCache(2 * 60 * 1000);
|
||||
timedCache.schedulePrune(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
return timedCache;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user