Remove unnecessary if state
This commit is contained in:
@@ -127,23 +127,21 @@ public class JedisSentinelPool extends Pool<Jedis> {
|
|||||||
try {
|
try {
|
||||||
jedis = new Jedis(hap.getHost(), hap.getPort());
|
jedis = new Jedis(hap.getHost(), hap.getPort());
|
||||||
|
|
||||||
if (master == null) {
|
List<String> masterAddr = jedis
|
||||||
List<String> masterAddr = jedis
|
.sentinelGetMasterAddrByName(masterName);
|
||||||
.sentinelGetMasterAddrByName(masterName);
|
|
||||||
|
|
||||||
// connected to sentinel...
|
// connected to sentinel...
|
||||||
sentinelAvailable = true;
|
sentinelAvailable = true;
|
||||||
|
|
||||||
if (masterAddr == null || masterAddr.size() != 2) {
|
if (masterAddr == null || masterAddr.size() != 2) {
|
||||||
log.warning("Can not get master addr, master name: "
|
log.warning("Can not get master addr, master name: "
|
||||||
+ masterName + ". Sentinel: " + hap + ".");
|
+ masterName + ". Sentinel: " + hap + ".");
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
master = toHostAndPort(masterAddr);
|
|
||||||
log.fine("Found Redis master at " + master);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
master = toHostAndPort(masterAddr);
|
||||||
|
log.fine("Found Redis master at " + master);
|
||||||
|
break;
|
||||||
} catch (JedisConnectionException e) {
|
} catch (JedisConnectionException e) {
|
||||||
log.warning("Cannot connect to sentinel running @ " + hap
|
log.warning("Cannot connect to sentinel running @ " + hap
|
||||||
+ ". Trying next one.");
|
+ ". Trying next one.");
|
||||||
|
|||||||
Reference in New Issue
Block a user