Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
31e4a08a
Commit
31e4a08a
authored
May 16, 2019
by
Edin
Committed by
Elune
May 16, 2019
Browse files
!2 redis databse 值 在api/redis接口中没生效
Merge pull request !2 from Edin/master
parents
83fe8fab
cffeaee5
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/redis/RedisConfig.java
View file @
31e4a08a
...
@@ -53,6 +53,9 @@ public class RedisConfig extends CachingConfigurerSupport {
...
@@ -53,6 +53,9 @@ public class RedisConfig extends CachingConfigurerSupport {
@Value
(
"${spring.redis.password}"
)
@Value
(
"${spring.redis.password}"
)
private
String
password
;
private
String
password
;
@Value
(
"${spring.redis.database}"
)
private
int
database
;
/**
/**
* 配置 redis 连接池
* 配置 redis 连接池
* @return
* @return
...
@@ -62,11 +65,8 @@ public class RedisConfig extends CachingConfigurerSupport {
...
@@ -62,11 +65,8 @@ public class RedisConfig extends CachingConfigurerSupport {
JedisPoolConfig
jedisPoolConfig
=
new
JedisPoolConfig
();
JedisPoolConfig
jedisPoolConfig
=
new
JedisPoolConfig
();
jedisPoolConfig
.
setMaxIdle
(
maxIdle
);
jedisPoolConfig
.
setMaxIdle
(
maxIdle
);
jedisPoolConfig
.
setMaxWaitMillis
(
maxWaitMillis
);
jedisPoolConfig
.
setMaxWaitMillis
(
maxWaitMillis
);
if
(
StringUtils
.
isNotBlank
(
password
))
{
String
pwd
=
StringUtils
.
isBlank
(
password
)
?
null
:
password
;
return
new
JedisPool
(
jedisPoolConfig
,
host
,
port
,
timeout
,
password
);
return
new
JedisPool
(
jedisPoolConfig
,
host
,
port
,
timeout
,
pwd
,
database
);
}
else
{
return
new
JedisPool
(
jedisPoolConfig
,
host
,
port
,
timeout
);
}
}
}
/**
/**
...
...
Write
Preview
Supports
Markdown
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