DATAREDIS-1173 - Correctly unsubscribe from patterns/channels through LettuceSubscription.
doPUnsubscribe(…) and doUnsubscribe(…) now consider the all flag to unsubscribe from all subscribed patterns/channels. Previously, both methods didn't consider all and were invoked with an empty byte array which unsubscribed from an empty pattern/channel name and left subscriptions active. Original Pull Request: #549
This commit is contained in:
committed by
Christoph Strobl
parent
17b0fbcc63
commit
e4fd036d81
@@ -95,8 +95,11 @@ public class LettuceSubscription extends AbstractSubscription {
|
||||
*/
|
||||
protected void doPUnsubscribe(boolean all, byte[]... patterns) {
|
||||
|
||||
// ignore `all` flag as Lettuce unsubscribes from all patterns if none provided.
|
||||
pubsub.punsubscribe(patterns);
|
||||
if (all) {
|
||||
pubsub.punsubscribe();
|
||||
} else {
|
||||
pubsub.punsubscribe(patterns);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -113,8 +116,11 @@ public class LettuceSubscription extends AbstractSubscription {
|
||||
*/
|
||||
protected void doUnsubscribe(boolean all, byte[]... channels) {
|
||||
|
||||
// ignore `all` flag as Lettuce unsubscribes from all channels if none provided.
|
||||
pubsub.unsubscribe(channels);
|
||||
if (all) {
|
||||
pubsub.unsubscribe();
|
||||
} else {
|
||||
pubsub.unsubscribe(channels);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user