Skip to content

Commit

Permalink
JedisPool timeout was broken. Values <= 0 where treated as -1, where …
Browse files Browse the repository at this point in the history
…0 is infinite
  • Loading branch information
xetorthio committed Jun 3, 2011
1 parent 8465720 commit 9006178
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/main/java/redis/clients/jedis/JedisPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9006178

Please sign in to comment.