删除 keys*
parent
8437b6f9ea
commit
80c0a72ac9
|
@ -10,12 +10,15 @@ import com.ljsd.jieling.logic.dao.root.GuildCache;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
||||||
import com.ljsd.jieling.logic.rank.IRank;
|
import com.ljsd.jieling.logic.rank.IRank;
|
||||||
|
import config.SGuildCheckpointConfig;
|
||||||
|
import manager.STableManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.data.redis.core.ZSetOperations;
|
import org.springframework.data.redis.core.ZSetOperations;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -369,9 +372,18 @@ public abstract class AbstractRank implements IRank {
|
||||||
RedisUtil.getInstence().zsetRemoveOne(RedisKey.getKey(redisKey,rkey,false),value);
|
RedisUtil.getInstence().zsetRemoveOne(RedisKey.getKey(redisKey,rkey,false),value);
|
||||||
}
|
}
|
||||||
public void removeAllRank(String rkey){
|
public void removeAllRank(String rkey){
|
||||||
|
Map<Integer, SGuildCheckpointConfig> configMap = STableManager.getConfig(SGuildCheckpointConfig.class);
|
||||||
|
if (configMap == null || configMap.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
|
// Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
|
||||||
dimKey.forEach(item->RedisUtil.getInstence().del(item));
|
String[] dimKey = new String[configMap.size()];
|
||||||
|
int index = 0;
|
||||||
|
for (Integer integer : configMap.keySet()) {
|
||||||
|
dimKey[index] = RedisKey.getKey(redisKey, rkey, false) + integer;
|
||||||
|
}
|
||||||
|
RedisUtil.getInstence().del(dimKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue