|
|
@ -222,7 +222,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
String hostname = hostnameMapper.apply(uri);
|
|
|
|
String hostname = hostnameMapper.apply(uri);
|
|
|
|
CompletableFuture<RedisClient> masterFuture = masterSlaveEntry.setupMasterEntry(uri, hostname);
|
|
|
|
CompletableFuture<RedisClient> masterFuture = masterSlaveEntry.setupMasterEntry(uri, hostname);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
masterFuture.get(config.getConnectTimeout(), TimeUnit.MILLISECONDS);
|
|
|
|
masterFuture.get(config.getConnectTimeout()*config.getMasterConnectionMinimumIdleSize(), TimeUnit.MILLISECONDS);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
Thread.currentThread().interrupt();
|
|
|
|
Thread.currentThread().interrupt();
|
|
|
|
} catch (ExecutionException | TimeoutException e) {
|
|
|
|
} catch (ExecutionException | TimeoutException e) {
|
|
|
@ -232,7 +232,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
if (!config.isSlaveNotUsed()) {
|
|
|
|
if (!config.isSlaveNotUsed()) {
|
|
|
|
CompletableFuture<Void> fs = masterSlaveEntry.initSlaveBalancer(disconnectedSlaves, hostnameMapper);
|
|
|
|
CompletableFuture<Void> fs = masterSlaveEntry.initSlaveBalancer(disconnectedSlaves, hostnameMapper);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
fs.get(config.getConnectTimeout(), TimeUnit.MILLISECONDS);
|
|
|
|
fs.get(config.getConnectTimeout()*config.getSlaveConnectionMinimumIdleSize(), TimeUnit.MILLISECONDS);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
Thread.currentThread().interrupt();
|
|
|
|
Thread.currentThread().interrupt();
|
|
|
|
} catch (ExecutionException | TimeoutException e) {
|
|
|
|
} catch (ExecutionException | TimeoutException e) {
|
|
|
|