Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
6cc206a0
Commit
6cc206a0
authored
Sep 25, 2020
by
tangzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改用redis的连接
parent
02d857a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
RedisUtil.java
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
+3
-7
No files found.
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
View file @
6cc206a0
...
...
@@ -107,8 +107,6 @@ public class RedisUtil {
}
public
static
void
set
(
String
key
,
Object
value
,
int
sessionTimeOut
)
throws
Exception
{
// checkRedisNodeAvailable();
try
{
masterNode
.
opsForValue
().
set
(
key
,
value
);
masterNode
.
expire
(
key
,
sessionTimeOut
,
TimeUnit
.
SECONDS
);
...
...
@@ -119,33 +117,31 @@ public class RedisUtil {
}
public
static
Object
get
(
String
key
)
throws
Exception
{
// checkRedisNodeAvailable();
// Object values=null;
try
{
return
masterNode
.
opsForValue
().
get
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
checkRedisNodeAvailable
();
}
return
null
;
}
public
static
Boolean
delete
(
String
key
)
throws
Exception
{
// checkRedisNodeAvailable();
try
{
return
masterNode
.
delete
(
key
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
checkRedisNodeAvailable
();
}
return
false
;
}
public
static
Set
keys
(
String
key
)
throws
Exception
{
// checkRedisNodeAvailable();
try
{
return
masterNode
.
keys
(
key
+
"*"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
checkRedisNodeAvailable
();
}
return
new
HashSet
();
}
...
...
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