提交修改
This commit is contained in:
parent
9c9841213d
commit
5eadf88f77
@ -77,10 +77,18 @@ public class RedisUtils {
|
||||
public static boolean BIZ_CACHE_SWITCH = true;//业务缓存开关,true:打开(即使用缓存) false:关闭(即不使用缓存)
|
||||
|
||||
public void set(String key, Object value, long expire) {
|
||||
valueOperations.set(key, toJson(value));
|
||||
if (expire != NOT_EXPIRE) {
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
|
||||
|
||||
try {
|
||||
valueOperations.set(key, toJson(value));
|
||||
if (expire != NOT_EXPIRE) {
|
||||
redisTemplate.expire(key, expire, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("set redis error", e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void set(String key, Object value) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user