JedisPool timeout was broken. Values <= 0 where treated as -1, where 0 is infinite
This commit is contained in:
@@ -48,17 +48,12 @@ public class JedisPool extends Pool<Jedis> {
|
|||||||
super();
|
super();
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
this.timeout = (timeout > 0) ? timeout : -1;
|
this.timeout = timeout;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object makeObject() throws Exception {
|
public Object makeObject() throws Exception {
|
||||||
final Jedis jedis;
|
final Jedis jedis = new Jedis(this.host, this.port, this.timeout);
|
||||||
if (timeout > 0) {
|
|
||||||
jedis = new Jedis(this.host, this.port, this.timeout);
|
|
||||||
} else {
|
|
||||||
jedis = new Jedis(this.host, this.port);
|
|
||||||
}
|
|
||||||
|
|
||||||
jedis.connect();
|
jedis.connect();
|
||||||
if (null != this.password) {
|
if (null != this.password) {
|
||||||
|
|||||||
Reference in New Issue
Block a user