Browse Source

update WxCpJedisConfigStorage, connect a redis with password and pool config (#202)

Change-Id: I3f5de67f148e599a1040239f71c9697e956c6873
Signed-off-by: zhangxintao <zhang.xintao@trans-cosmos.com.cn>
master
蘑菇0202 8 years ago
committed by Binary Wang
parent
commit
a1faf8d2a2
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java

+ 5
- 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java View File

@@ -4,6 +4,7 @@ import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;


import java.io.File; import java.io.File;


@@ -38,6 +39,10 @@ public class WxCpJedisConfigStorage implements WxCpConfigStorage {
this.jedisPool = new JedisPool(host, port); this.jedisPool = new JedisPool(host, port);
} }


public WxCpJedisConfigStorage(JedisPoolConfig poolConfig, String host, int port, int timeout, final String password) {
this.jedisPool = new JedisPool(poolConfig, host, port, timeout, password);
}

/** /**
* This method will be destroy jedis pool * This method will be destroy jedis pool
*/ */


Loading…
Cancel
Save