更改redis配置
This commit is contained in:
@@ -25,11 +25,8 @@ import java.util.List;
|
|||||||
@Component
|
@Component
|
||||||
public class RedisUtilConfig {
|
public class RedisUtilConfig {
|
||||||
|
|
||||||
@Value("${redis.host}")
|
@Value("${redis.host.uri}")
|
||||||
private String host;
|
private String REDIS_HOST_URI;
|
||||||
|
|
||||||
@Value("${redis.password}")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RedisUtilPool redisUtilPool() {
|
public RedisUtilPool redisUtilPool() {
|
||||||
@@ -43,8 +40,7 @@ public class RedisUtilConfig {
|
|||||||
jedisPoolConfig.setTestOnBorrow(false);
|
jedisPoolConfig.setTestOnBorrow(false);
|
||||||
|
|
||||||
List<JedisShardInfo> shards = new ArrayList<>();
|
List<JedisShardInfo> shards = new ArrayList<>();
|
||||||
JedisShardInfo jedisShardInfo = new JedisShardInfo(host);
|
JedisShardInfo jedisShardInfo = new JedisShardInfo(REDIS_HOST_URI);
|
||||||
jedisShardInfo.setPassword(password);
|
|
||||||
shards.add(jedisShardInfo);
|
shards.add(jedisShardInfo);
|
||||||
redisUtil.setShardedJedisPool(new ShardedJedisPool(jedisPoolConfig, shards));
|
redisUtil.setShardedJedisPool(new ShardedJedisPool(jedisPoolConfig, shards));
|
||||||
return redisUtil;
|
return redisUtil;
|
||||||
|
|||||||
Reference in New Issue
Block a user