十绝阵定时清理
parent
045e1ce82f
commit
081266e83d
|
@ -565,7 +565,7 @@ public class RedisUtil {
|
|||
// 根据key获取要删除的key
|
||||
Set<String> removeSet = RedisUtil.getInstence().sGet(key);
|
||||
// 根据正则表达式去除不用删除的key
|
||||
removeSet.removeIf(v-> !Pattern.matches(pattern,v));
|
||||
removeSet.removeIf(v-> !Pattern.matches(pattern,v) || v.equals(key));
|
||||
// 转换数组
|
||||
String[] removeKeys = removeSet.toArray(new String[0]);
|
||||
long remove = 0;
|
||||
|
@ -1416,7 +1416,7 @@ public class RedisUtil {
|
|||
* 助战rediskey处理
|
||||
*/
|
||||
private void helpHeroKeyHandler(String key){
|
||||
if(key.contains(RedisKey.HELP_FIGHT)){
|
||||
if(key.contains("HELP_FIGHT")){
|
||||
RedisUtil.getInstence().sSet(RedisKey.HELP_FIGHT_DELETE,key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,11 +206,11 @@ public class CrossDeathPathLogic {
|
|||
}
|
||||
RedisUtil.getInstence().hdel(RedisKey.DEATH_PATH_EVERY_OVER_HASH,String.valueOf(serverId));
|
||||
|
||||
boolean lock = RedisUtil.getInstence().lock(RedisKey.DEATH_PATH_DELETE_CROSS+":"+groupId, TimeUtils.ONE_MINUTE * 2);
|
||||
boolean lock = RedisUtil.getInstence().lock(RedisKey.DEATH_PATH_DELETE_CROSS, TimeUtils.ONE_MINUTE * 2);
|
||||
// 拿到锁的操作删除
|
||||
if (lock){
|
||||
// 删除rediskey
|
||||
String pattern = "DEATH_PATH.*."+groupId+":.*";
|
||||
String pattern = "DEATH_PATH.*";
|
||||
RedisUtil.getInstence().delVague(RedisKey.DEATH_PATH_DELETE,pattern);
|
||||
|
||||
// 旧数据兼容,只执行一次
|
||||
|
|
|
@ -732,7 +732,7 @@ public class DeathPathLogic {
|
|||
DeathChallengeCount challengeCount;
|
||||
String key = RedisKey.DEATH_PATH_TOTAL_CHALLENGE_COUNT;
|
||||
if (getGroupId() > 0){
|
||||
key = RedisKey.DEATH_PATH_TOTAL_CHALLENGE_COUNT + ":" + GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
key = key + ":" + GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
challengeCount = RedisUtil.getInstence().get(key, String.valueOf(guildId), DeathChallengeCount.class, false);
|
||||
}else {
|
||||
challengeCount = RedisUtil.getInstence().get(key, String.valueOf(guildId), DeathChallengeCount.class,true);
|
||||
|
@ -747,7 +747,7 @@ public class DeathPathLogic {
|
|||
public void setDeathChallengeCount(int guildId, DeathChallengeCount countInfo){
|
||||
String key = RedisKey.DEATH_PATH_TOTAL_CHALLENGE_COUNT;
|
||||
if (getGroupId() > 0){
|
||||
key = RedisKey.DEATH_PATH_TOTAL_CHALLENGE_COUNT + ":" + GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
key = key + ":" + GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
RedisUtil.getInstence().set(key, String.valueOf(guildId),countInfo,false);
|
||||
}else {
|
||||
RedisUtil.getInstence().set(key, String.valueOf(guildId),countInfo,true);
|
||||
|
|
Loading…
Reference in New Issue