Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Updated Redisson cluster mode config init.
Browse files Browse the repository at this point in the history
  • Loading branch information
kishorebanala committed Nov 13, 2019
1 parent 90ab659 commit 952953e
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public RedisLock(RedisLockConfiguration configuration) {
config.useSingleServer().setAddress(redisServerAddress).setTimeout(connectionTimeout);
break;
case CLUSTER:
config.useClusterServers().addNodeAddress(redisServerAddress).setTimeout(connectionTimeout);
config.useClusterServers()
.setScanInterval(2000) // cluster state scan interval in milliseconds
.addNodeAddress(redisServerAddress.split(","))
.setTimeout(connectionTimeout);
break;
case SENTINEL:
config.useSentinelServers().addSentinelAddress(redisServerAddress).setTimeout(connectionTimeout);
Expand Down Expand Up @@ -104,11 +107,6 @@ public void releaseLock(String lockId) {
}
}

/**
* Redlock deletes the lock on release.
* @param lockId
* @return
*/
@Override
public void deleteLock(String lockId) {
// Noop for Redlock algorithm as releaseLock / unlock deletes it.
Expand Down

0 comments on commit 952953e

Please sign in to comment.