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
4035276a
Commit
4035276a
authored
Sep 30, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ehcache
parent
d98cc350
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
core/src/main/java/com/wecloud/im/service/EhcacheService.java
+7
-4
No files found.
core/src/main/java/com/wecloud/im/service/EhcacheService.java
View file @
4035276a
...
@@ -2,6 +2,7 @@ package com.wecloud.im.service;
...
@@ -2,6 +2,7 @@ package com.wecloud.im.service;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.Cache
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.cache.CacheManager
;
...
@@ -27,12 +28,14 @@ public class EhcacheService {
...
@@ -27,12 +28,14 @@ public class EhcacheService {
*/
*/
public
Boolean
getIsPush
(
String
key
)
{
public
Boolean
getIsPush
(
String
key
)
{
Cache
cache
=
cacheManager
.
getCache
(
"push"
);
Cache
cache
=
cacheManager
.
getCache
(
"push"
);
Object
value
=
cache
.
get
(
key
);
String
value
=
String
.
valueOf
(
cache
.
get
(
key
));
log
.
info
(
"ehcache {}"
,
JSON
.
toJSONString
(
value
));
log
.
info
(
"ehcache value {}"
,
value
);
if
(
value
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
value
))
{
log
.
info
(
"not blank {}"
,
value
);
return
false
;
return
false
;
}
else
{
}
else
{
cache
.
put
(
key
,
1
);
log
.
info
(
"blank"
);
cache
.
put
(
key
,
"1"
);
return
true
;
return
true
;
}
}
}
}
...
...
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