Skip to content

Commit 534acdc

Browse files
committed
Polishing.
Avoid races in command unsubscribe fetching. See #2226
1 parent e2dc10a commit 534acdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveSubscription.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public Mono<Void> pSubscribe(ByteBuffer... patterns) {
101101
*/
102102
@Override
103103
public Mono<Void> unsubscribe() {
104-
return unsubscribe(channelState.getTargets().toArray(new ByteBuffer[channelState.getTargets().size()]));
104+
return unsubscribe(channelState.getTargets().toArray(new ByteBuffer[0]));
105105
}
106106

107107
/*
@@ -123,7 +123,7 @@ public Mono<Void> unsubscribe(ByteBuffer... channels) {
123123
*/
124124
@Override
125125
public Mono<Void> pUnsubscribe() {
126-
return pUnsubscribe(patternState.getTargets().toArray(new ByteBuffer[patternState.getTargets().size()]));
126+
return pUnsubscribe(patternState.getTargets().toArray(new ByteBuffer[0]));
127127
}
128128

129129
/*

0 commit comments

Comments
 (0)