mirror of
https://github.com/redis/go-redis.git
synced 2025-08-01 16:06:54 +03:00
Add race test for big vals. Copy connection to avoid race with PubSub.
This commit is contained in:
@ -54,6 +54,7 @@ func (c *PubSub) subscribe(redisCmd string, channels ...string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.putConn(cn, err)
|
||||
|
||||
args := make([]interface{}, 1+len(channels))
|
||||
args[0] = redisCmd
|
||||
@ -306,6 +307,9 @@ func (c *PubSub) putConn(cn *pool.Conn, err error) {
|
||||
}
|
||||
|
||||
func (c *PubSub) resubscribe() {
|
||||
if c.base.closed() {
|
||||
return
|
||||
}
|
||||
if len(c.channels) > 0 {
|
||||
if err := c.Subscribe(c.channels...); err != nil {
|
||||
Logger.Printf("Subscribe failed: %s", err)
|
||||
|
Reference in New Issue
Block a user