暂时注释掉代码

parent 8a813e40
...@@ -181,13 +181,21 @@ public class SessionServiceImpl implements ISessionService { ...@@ -181,13 +181,21 @@ public class SessionServiceImpl implements ISessionService {
@Override @Override
public void deleteByUserId(long userId) { public void deleteByUserId(long userId) {
String pattern = Constants.Session.USER_SESSION_ID_CACHE + ":" + String.valueOf(userId) + ":*";
Set<String> keys = stringRedisTemplate.keys(pattern);
if (!CollectionUtils.isEmpty(keys)) {
log.info("删除用户userId={}的缓存信息,个数:{},keys={}", userId,
keys.size(),
Joiner.on(",").join(keys));
}
Set useIdKeys = stringRedisTemplate.opsForSet().members(Constants.Session.USER_SESSION_KEY_SET + userId); /* Set useIdKeys = stringRedisTemplate.opsForSet().members(Constants.Session.USER_SESSION_KEY_SET + userId);
if (!CollectionUtils.isEmpty(useIdKeys)) { if (!CollectionUtils.isEmpty(useIdKeys)) {
useIdKeys.forEach(key -> { useIdKeys.forEach(key -> {
log.info("删除用户userId={}的缓存信息",userId);
stringRedisTemplate.delete(String.valueOf(key)); stringRedisTemplate.delete(String.valueOf(key));
}); });
} }*/
} }
} }
...@@ -17,7 +17,7 @@ xyqb.filter.allowedHeaders=Origin, No-Cache, x-auth-token, X-Requested-With, If- ...@@ -17,7 +17,7 @@ xyqb.filter.allowedHeaders=Origin, No-Cache, x-auth-token, X-Requested-With, If-
xyqb.data.redis.defaultExpiration=3600 xyqb.data.redis.defaultExpiration=3600
# redis # redis
xyqb.redis.master.host=192.168.4.22 xyqb.redis.master.host=192.168.4.153
xyqb.redis.master.port=6379 xyqb.redis.master.port=6379
xyqb.redis.master.name= xyqb.redis.master.name=
xyqb.redis.sentinel1.host= xyqb.redis.sentinel1.host=
......
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