|
@@ -15,6 +15,9 @@ public class RedisConfig {
|
|
@Value("${spring.redis.port}")
|
|
@Value("${spring.redis.port}")
|
|
private int port;
|
|
private int port;
|
|
|
|
|
|
|
|
+ @Value("${spring.redis.password}")
|
|
|
|
+ private String password;
|
|
|
|
+
|
|
@Value("${spring.redis.timeout}")
|
|
@Value("${spring.redis.timeout}")
|
|
private int timeout;
|
|
private int timeout;
|
|
|
|
|
|
@@ -39,7 +42,7 @@ public class RedisConfig {
|
|
jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted);
|
|
jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted);
|
|
// 是否启用pool的jmx管理功能, 默认true
|
|
// 是否启用pool的jmx管理功能, 默认true
|
|
jedisPoolConfig.setJmxEnabled(JmxEnabled);
|
|
jedisPoolConfig.setJmxEnabled(JmxEnabled);
|
|
- JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout);
|
|
|
|
|
|
+ JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout,password);
|
|
return jedisPool;
|
|
return jedisPool;
|
|
}
|
|
}
|
|
}
|
|
}
|