!2 redis databse 值 在api/redis接口中没生效

Merge pull request !2 from Edin/master
pull/127/head
Edin 2019-05-16 10:47:42 +08:00 committed by Elune
commit 31e4a08a31
1 changed files with 5 additions and 5 deletions

View File

@ -53,6 +53,9 @@ public class RedisConfig extends CachingConfigurerSupport {
@Value("${spring.redis.password}")
private String password;
@Value("${spring.redis.database}")
private int database;
/**
* redis
* @return
@ -62,11 +65,8 @@ public class RedisConfig extends CachingConfigurerSupport {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxIdle(maxIdle);
jedisPoolConfig.setMaxWaitMillis(maxWaitMillis);
if (StringUtils.isNotBlank(password)) {
return new JedisPool(jedisPoolConfig, host, port, timeout, password);
} else {
return new JedisPool(jedisPoolConfig, host, port,timeout);
}
String pwd = StringUtils.isBlank(password) ? null : password;
return new JedisPool(jedisPoolConfig, host, port, timeout, pwd, database);
}
/**