ISSUE 78: Removed logic that waits forever till all shards are connected in ShardedJedisPool
Ensuered that all commands connect at the beginning if necessary.
This commit is contained in:
@@ -27,6 +27,8 @@ public class BinaryClient extends Connection {
|
||||
}
|
||||
|
||||
private boolean isInMulti;
|
||||
|
||||
private String password;
|
||||
|
||||
public boolean isInMulti() {
|
||||
return isInMulti;
|
||||
@@ -39,6 +41,21 @@ public class BinaryClient extends Connection {
|
||||
public BinaryClient(final String host, final int port) {
|
||||
super(host, port);
|
||||
}
|
||||
|
||||
public void setPassword(final String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connect() {
|
||||
if (!isConnected()) {
|
||||
super.connect();
|
||||
if (password != null) {
|
||||
sendCommand(AUTH, password);
|
||||
getStatusCodeReply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ping() {
|
||||
sendCommand(PING);
|
||||
@@ -438,6 +455,7 @@ public class BinaryClient extends Connection {
|
||||
}
|
||||
|
||||
public void auth(final String password) {
|
||||
setPassword(password);
|
||||
sendCommand(AUTH, password);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user