Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
ed6fd463
Commit
ed6fd463
authored
Apr 29, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserStateCacheManager调整日志
parent
e55c439c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
core/src/main/java/com/wecloud/im/ws/cache/UserStateCacheManager.java
+11
-7
No files found.
core/src/main/java/com/wecloud/im/ws/cache/UserStateCacheManager.java
View file @
ed6fd463
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
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment