Skip to content

Commit

Permalink
Fixed - read mode = SLAVE isn't applied for RSet.random() methods. #5871
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koksharov committed May 16, 2024
1 parent ef90ee1 commit 0792155
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions redisson/src/main/java/org/redisson/RedissonSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public V random() {

@Override
public RFuture<V> randomAsync() {
return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.SRANDMEMBER_SINGLE, getRawName());
return commandExecutor.readAsync(getRawName(), codec, RedisCommands.SRANDMEMBER_SINGLE, getRawName());
}

@Override
Expand All @@ -255,7 +255,7 @@ public Set<V> random(int count) {

@Override
public RFuture<Set<V>> randomAsync(int count) {
return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.SRANDMEMBER, getRawName(), count);
return commandExecutor.readAsync(getRawName(), codec, RedisCommands.SRANDMEMBER, getRawName(), count);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public V random() {

@Override
public RFuture<V> randomAsync() {
return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.SRANDMEMBER_SINGLE, getRawName());
return commandExecutor.readAsync(getRawName(), codec, RedisCommands.SRANDMEMBER_SINGLE, getRawName());
}

@Override
Expand All @@ -397,7 +397,7 @@ public Set<V> random(int count) {

@Override
public RFuture<Set<V>> randomAsync(int count) {
return commandExecutor.writeAsync(getRawName(), codec, RedisCommands.SRANDMEMBER, getRawName(), count);
return commandExecutor.readAsync(getRawName(), codec, RedisCommands.SRANDMEMBER, getRawName(), count);
}

@Override
Expand Down

0 comments on commit 0792155

Please sign in to comment.