Skip to content

Commit

Permalink
set listener to deamon thread
Browse files Browse the repository at this point in the history
Signed-off-by: c00603587 <[email protected]>
  • Loading branch information
c00603587 committed Sep 20, 2023
1 parent ec1e92f commit 33c6ece
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/redis/clients/jedis/JedisSentinelPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private void initMasterListeners(Set<HostAndPort> sentinels, String masterName)
private void initMasterListeners(Set<HostAndPort> sentinels, String masterName,
GenericObjectPoolConfig<Jedis> poolConfig) {

LOG.info("Init master node listener {}", masterName);
LOG.info("Starting Sentinel listeners for {}...", masterName);
SentinelPoolConfig jedisSentinelPoolConfig = null;
if (poolConfig instanceof SentinelPoolConfig) {
jedisSentinelPoolConfig = ((SentinelPoolConfig) poolConfig);
Expand Down Expand Up @@ -232,7 +232,6 @@ public void onChange(HostAndPort hostAndPort) {
});
}
}

masterListeners.forEach(SentinelMasterListener::start);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public SentinelMasterActiveDetectListener(HostAndPort currentHostMaster, HostAnd
this.jedisClientConfig = jedisClientConfig;
this.masterName = masterName;
this.activeDetectIntervalTimeMillis = activeDetectIntervalTimeMillis;
this.setDaemon(true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public SentinelMasterSubscribeListener(String masterName, HostAndPort sentinel,
this.sentinel = sentinel;
this.sentinelClientConfig = sentinelClientConfig;
this.subscribeRetryWaitTimeMillis = subscribeRetryWaitTimeMillis;
this.setDaemon(true);
}

@Override
Expand Down

0 comments on commit 33c6ece

Please sign in to comment.