Merge pull request #48 from shankai/master

Fix: unsubscribe single channel from (p)subscribe.
This commit is contained in:
Josh Baker 2022-03-22 10:55:55 -07:00 committed by GitHub
commit 12fd027cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -1358,14 +1358,12 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
}
} else {
// unsubscribe single channel from (p)subscribe.
var entry *pubSubEntry
for ient := range sconn.entries {
if ient.pattern == pattern && ient.channel == channel {
removeEntry(entry)
removeEntry(ient)
break
}
}
removeEntry(entry)
}
sconn.dconn.Flush()
}