Fixed - status listener should be invoked only for channel it added

pull/860/head
Nikita 8 years ago
parent 0f2a3c6ffc
commit 0a876bd5fa

@ -75,6 +75,7 @@ public class PubSubPatternStatusListener<V> implements RedisPubSubListener<V> {
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (channel.equals(name)) {
if (type == PubSubType.PSUBSCRIBE) { if (type == PubSubType.PSUBSCRIBE) {
listener.onPSubscribe(channel); listener.onPSubscribe(channel);
} else if (type == PubSubType.PUNSUBSCRIBE) { } else if (type == PubSubType.PUNSUBSCRIBE) {
@ -82,5 +83,7 @@ public class PubSubPatternStatusListener<V> implements RedisPubSubListener<V> {
} }
return true; return true;
} }
return false;
}
} }

@ -75,6 +75,7 @@ public class PubSubStatusListener<V> implements RedisPubSubListener<V> {
@Override @Override
public boolean onStatus(PubSubType type, String channel) { public boolean onStatus(PubSubType type, String channel) {
if (channel.equals(name)) {
if (type == PubSubType.SUBSCRIBE) { if (type == PubSubType.SUBSCRIBE) {
listener.onSubscribe(channel); listener.onSubscribe(channel);
} else if (type == PubSubType.UNSUBSCRIBE) { } else if (type == PubSubType.UNSUBSCRIBE) {
@ -82,5 +83,7 @@ public class PubSubStatusListener<V> implements RedisPubSubListener<V> {
} }
return true; return true;
} }
return false;
}
} }

Loading…
Cancel
Save