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