1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

fix: PubSub isn't concurrency-safe (#3360)

This commit is contained in:
fukua95
2025-04-29 14:39:26 +08:00
committed by GitHub
parent 4bd5d417ca
commit bb8d508481

View File

@ -45,6 +45,9 @@ func (c *PubSub) init() {
}
func (c *PubSub) String() string {
c.mu.Lock()
defer c.mu.Unlock()
channels := mapKeys(c.channels)
channels = append(channels, mapKeys(c.patterns)...)
channels = append(channels, mapKeys(c.schannels)...)