reverted back vetify() as connection checks could be disabled in pool config
This commit is contained in:
@@ -61,7 +61,17 @@ public class ShardedJedisPool extends Pool<ShardedJedis> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean validateObject(final Object obj) {
|
public boolean validateObject(final Object obj) {
|
||||||
return true;
|
try {
|
||||||
|
ShardedJedis jedis = (ShardedJedis) obj;
|
||||||
|
for (Jedis shard : jedis.getAllShards()) {
|
||||||
|
if (!shard.isConnected() || !shard.ping().equals("PONG")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user