Commit ed6fd463 by 罗长华

UserStateCacheManager调整日志

parent e55c439c
package com.wecloud.im.ws.cache; package com.wecloud.im.ws.cache;
import com.wecloud.utils.GetIpUtils;
import com.wecloud.im.ws.model.redis.ClientChannelInfo;
import com.wecloud.im.ws.utils.RedisUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wecloud.im.ws.model.redis.ClientChannelInfo;
import com.wecloud.im.ws.utils.RedisUtils;
import com.wecloud.utils.GetIpUtils;
/** /**
* @author hewei123@163.com * @author hewei123@163.com
* @Description 用户与redis绑定 * @Description 用户与redis绑定
...@@ -48,8 +50,10 @@ public class UserStateCacheManager extends UserStateListener { ...@@ -48,8 +50,10 @@ public class UserStateCacheManager extends UserStateListener {
@Override @Override
public void offlineEvent(Long clientId, Integer platform, String longChannelId) { public void offlineEvent(Long clientId, Integer platform, String longChannelId) {
log.info("ws用户离线删除redis key,uid: {}, clientId: {}", longChannelId, clientId); String key = getUserStateCacheKey(clientId);
redisUtils.removeForSet(getUserStateCacheKey(clientId), platform + RedisUtils.SPLIT + GetIpUtils.getlanIp()); String value = platform + RedisUtils.SPLIT + GetIpUtils.getlanIp();
log.info("ws用户离线删除redis key: {}, value: {}, uid: {}, clientId: {}", key, value, longChannelId, clientId);
redisUtils.removeForSet(key, value);
} }
/** /**
......
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