mirror of https://github.com/elunez/eladmin
redis databse 值 在api/redis接口中没生效
parent
83fe8fabaa
commit
cffeaee57e
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue