车迟斗法缓存问题修改
parent
f6f5a3c60f
commit
3a4bceeaca
|
@ -145,13 +145,14 @@ public class RedisUtil {
|
|||
String oldName = key[i];
|
||||
// 新名字
|
||||
String newName = oldName+"BACK:"+System.currentTimeMillis();
|
||||
// 重命名
|
||||
if(get(oldName)==null){
|
||||
continue;
|
||||
// key是否存在
|
||||
boolean aBoolean = hasKey(oldName);
|
||||
if (aBoolean){
|
||||
// 重命名
|
||||
redisTemplate.rename(oldName,newName);
|
||||
// 设置过期时间
|
||||
expire(newName,60*60*24-60);
|
||||
}
|
||||
redisTemplate.rename(oldName,newName);
|
||||
// 设置过期时间
|
||||
expire(newName,60*60*24-60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue