mirror of
https://github.com/redis/go-redis.git
synced 2025-08-01 16:06:54 +03:00
Reuse connections to Redis during tests.
This commit is contained in:
@ -41,13 +41,18 @@ func (c *PubSubClient) consumeMessages(conn *Conn) {
|
||||
for {
|
||||
msg := &Message{}
|
||||
|
||||
replyI, err := req.ParseReply(conn.Rd)
|
||||
replyIface, err := req.ParseReply(conn.Rd)
|
||||
if err != nil {
|
||||
msg.Err = err
|
||||
c.ch <- msg
|
||||
break
|
||||
}
|
||||
reply := replyI.([]interface{})
|
||||
reply, ok := replyIface.([]interface{})
|
||||
if !ok {
|
||||
msg.Err = fmt.Errorf("redis: unexpected reply type %T", replyIface)
|
||||
c.ch <- msg
|
||||
return
|
||||
}
|
||||
|
||||
msgName := reply[0].(string)
|
||||
switch msgName {
|
||||
|
Reference in New Issue
Block a user