Commit e30faeff by 陈文顺

防止缓存穿透

parent ae7af849
...@@ -28,7 +28,7 @@ public abstract class RedisCache<T> { ...@@ -28,7 +28,7 @@ public abstract class RedisCache<T> {
value = searchDB(key); value = searchDB(key);
if (value == null){ if (value == null){
redisUitl.setEx(redisKey, value,30, TimeUnit.SECONDS); redisUitl.setEx(redisKey, "",30, TimeUnit.SECONDS);
}else { }else {
redisUitl.setEx( redisKey,value, getExprie(), TimeUnit.SECONDS); redisUitl.setEx( redisKey,value, getExprie(), TimeUnit.SECONDS);
......
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