Authored by qinchao

redis清理缓存

... ... @@ -334,7 +334,7 @@ public class RedisCommonUtil {
Jedis client =null;
try {
client=new Jedis(host, port);
client=new Jedis(host, port,2 * 1000);
ScanParams scanParams = new ScanParams();
scanParams.count(1000);//每次扫描多少条记录,值越大消耗的时间越短,但会影响redis性能。建议设为一千到一万
scanParams.match(prefix+"*");
... ...
... ... @@ -335,7 +335,7 @@ public class RedisOperateServiceImpl implements RedisOperateService {
sb.append("<br/>");
}
sb.append("total delete "+RedisCommonUtil.removeRedisKeyByPrefix(ip,port,prefix)+" keys with prefix "+prefix+" at "+ipAndPortStr);
}
}
... ...