Skip to content

Commit

Permalink
🎨 redis增加连接超时配置参数
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Jun 16, 2021
1 parent 943e676 commit 6848465
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ wx:
redisConfig:
host: 127.0.0.1
port: 6379
timeout: 2000
configs:
- appId: 1111 # 第一个公众号的appid
secret: 1111 # 公众号的appsecret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public WxMpService wxMpService() {
final WxMpProperties.RedisConfig redisConfig = this.properties.getRedisConfig();
JedisPoolConfig poolConfig = new JedisPoolConfig();
JedisPool jedisPool = new JedisPool(poolConfig, redisConfig.getHost(), redisConfig.getPort(),
2000, redisConfig.getPassword());
redisConfig.getTimeout(), redisConfig.getPassword());
configStorage = new WxMpRedisConfigImpl(new JedisWxRedisOps(jedisPool), a.getAppId());
} else {
configStorage = new WxMpDefaultConfigImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public static class RedisConfig {
* redis服务器 密码
*/
private String password;

/**
* redis 服务连接超时时间
*/
private Integer timeout;
}

/**
Expand Down

0 comments on commit 6848465

Please sign in to comment.