i got exception
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
why not release the connect ??
def withRedis(Closure closure) {
Jedis redis = redisPool.resource
try {
def ret = closure(redis)
redisPool.returnResource(redis)
return ret
} catch(JedisConnectionException jce) {
redisPool.returnBrokenResource(redis)
throw jce
} catch(Exception e) {
redisPool.returnResource(redis)
throw e
}
}
why there is no block with
finally {
redis.close()
}