Fix: unsubscribe single channel from (p)subscribe.

This commit is contained in:
shankai 2021-07-15 18:44:48 +08:00
parent 0cb26bc5a4
commit 0f365a5602
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()
}