Skip to content

Commit df7cc77

Browse files
[fix] Subscribe only once per room (#175)
1 parent a1861cb commit df7cc77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ function adapter(uri, opts) {
401401
Redis.prototype.add = function(id, room, fn){
402402
debug('adding %s to %s ', id, room);
403403
var self = this;
404+
// subscribe only once per room
405+
var alreadyHasRoom = this.rooms.hasOwnProperty(room);
404406
Adapter.prototype.add.call(this, id, room);
405407

406-
if (!this.withChannelMultiplexing) {
408+
if (!this.withChannelMultiplexing || alreadyHasRoom) {
407409
if (fn) fn(null);
408410
return;
409411
}

0 commit comments

Comments
 (0)