Add exception handling in caso of unexecpected errors
This commit is contained in:
@@ -28,10 +28,12 @@ public abstract class JedisClusterConnectionHandler {
|
|||||||
hostAndPort.getPort());
|
hostAndPort.getPort());
|
||||||
this.nodes.put(hostAndPort.getHost() + hostAndPort.getPort(), jp);
|
this.nodes.put(hostAndPort.getHost() + hostAndPort.getPort(), jp);
|
||||||
Jedis jedis = jp.getResource();
|
Jedis jedis = jp.getResource();
|
||||||
discoverClusterNodesAndSlots(jedis);
|
try {
|
||||||
jp.returnResource(jedis);
|
discoverClusterNodesAndSlots(jedis);
|
||||||
|
} finally {
|
||||||
|
jp.returnResource(jedis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void discoverClusterNodesAndSlots(Jedis jedis) {
|
private void discoverClusterNodesAndSlots(Jedis jedis) {
|
||||||
|
|||||||
Reference in New Issue
Block a user