Permalink
Browse files

JedisPool timeout was broken. Values <= 0 where treated as -1, where …

…0 is infinite
  • Loading branch information...
1 parent 8465720 commit 9006178a05df3586cc4bfac61634f3bed735cbc1 @xetorthio xetorthio committed Jun 3, 2011
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/main/java/redis/clients/jedis/JedisPool.java
@@ -48,17 +48,12 @@ public JedisFactory(final String host, final int port,
super();
this.host = host;
this.port = port;
- this.timeout = (timeout > 0) ? timeout : -1;
+ this.timeout = timeout;
this.password = password;
}
public Object makeObject() throws Exception {
- final Jedis jedis;
- if (timeout > 0) {
- jedis = new Jedis(this.host, this.port, this.timeout);
- } else {
- jedis = new Jedis(this.host, this.port);
- }
+ final Jedis jedis = new Jedis(this.host, this.port, this.timeout);
jedis.connect();
if (null != this.password) {

0 comments on commit 9006178

Please sign in to comment.