Authored by qinchao

redis清理缓存

@@ -326,6 +326,7 @@ public class RedisCommonUtil { @@ -326,6 +326,7 @@ public class RedisCommonUtil {
326 * redis 清除缓存 ,根据前缀 326 * redis 清除缓存 ,根据前缀
327 */ 327 */
328 public static Long removeRedisKeyByPrefix(String host,int port,String prefix){ 328 public static Long removeRedisKeyByPrefix(String host,int port,String prefix){
  329 + logger.info("removeRedisKeyByPrefix begin {},{},{} ",host ,port ,prefix);
329 Long total=0L; 330 Long total=0L;
330 if(StringUtils.isBlank(prefix)){ 331 if(StringUtils.isBlank(prefix)){
331 return total; 332 return total;
@@ -351,7 +352,9 @@ public class RedisCommonUtil { @@ -351,7 +352,9 @@ public class RedisCommonUtil {
351 } 352 }
352 } 353 }
353 354
354 - nextCursor=new String(sr.getCursorAsBytes(),"UTF-8"); 355 + //nextCursor=new String(sr.getCursorAsBytes(),"UTF-8");
  356 + nextCursor=sr.getStringCursor();
  357 + logger.info("removeRedisKeyByPrefix nextCursor {}",nextCursor);
355 }while (!nextCursor.equals("0")); 358 }while (!nextCursor.equals("0"));
356 359
357 //删除 360 //删除
@@ -363,7 +366,7 @@ public class RedisCommonUtil { @@ -363,7 +366,7 @@ public class RedisCommonUtil {
363 } 366 }
364 367
365 }catch (Exception e){ 368 }catch (Exception e){
366 - logger.error(e.toString()); 369 + logger.error("removeRedisKeyByPrefix error {}",e);
367 }finally { 370 }finally {
368 if(client!=null){ 371 if(client!=null){
369 client.close(); 372 client.close();