Skip to content

Commit

Permalink
send AUTH message if sentinel password is set (#2154)
Browse files Browse the repository at this point in the history
Co-authored-by: M Sazzadul Hoque <[email protected]>
  • Loading branch information
kkolanow and sazzad16 authored Apr 14, 2020
1 parent e9949b3 commit 07575b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/JedisSentinelPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public JedisSentinelPool(String masterName, Set<String> sentinels, String passwo
this(masterName, sentinels, new GenericObjectPoolConfig(), Protocol.DEFAULT_TIMEOUT, password);
}

public JedisSentinelPool(String masterName, Set<String> sentinels, String password, String sentinelPassword) {
this(masterName, sentinels, new GenericObjectPoolConfig(), Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT,
password,Protocol.DEFAULT_DATABASE, null, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, sentinelPassword, null);
}

public JedisSentinelPool(String masterName, Set<String> sentinels,
final GenericObjectPoolConfig poolConfig, int timeout, final String password) {
this(masterName, sentinels, poolConfig, timeout, password, Protocol.DEFAULT_DATABASE);
Expand Down Expand Up @@ -325,6 +330,7 @@ public void run() {
running.set(true);

while (running.get()) {

try {
// double check that it is not being shutdown
if (!running.get()) {
Expand Down

0 comments on commit 07575b8

Please sign in to comment.