We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func runRecv(mq *MessageQueue) { conn := mq.pool.Get() defer conn.Close() tmp := rand.Intn(1000000000) var runningErr error psc := redis.PubSubConn{Conn: conn} for { v := psc.ReceiveWithTimeout(100 * time.Millisecond) switch msg := v.(type) { case redis.Message: log.Info("Message", tmp, msg.Channel, msg.Data) mq.broadcastMessage(msg.Channel, msg.Data) case redis.Subscription: log.Info("Subscription change:%v %s: %s %d\n", tmp, msg.Kind, msg.Channel, msg.Count) case error: if msg != nil { if nErr, ok := msg.(net.Error); ok && nErr.Timeout() { log.Error("Redis Timeout error:", tmp, msg, conn.Err()) if err := psc.Subscribe("foo"); err != nil { log.Info("Ping failed:", err) runningErr = err } continue } else { runningErr = msg log.Error("Redis error:", tmp, msg, conn.Err(), runningErr) } } } } }
During the second loop, the error "use of closed network connection" keeps occurring. at line:log.Error("Redis error:", xxxx)
maybe there is some bugs here?
func (c *conn) ReceiveWithTimeout(timeout time.Duration) (reply interface{}, err error) { // should be check is Timeout Err? if reply, err = c.readReply(); err != nil { return nil, c.fatal(err) } // }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
During the second loop, the error "use of closed network connection" keeps occurring. at line:log.Error("Redis error:", xxxx)
maybe there is some bugs here?
The text was updated successfully, but these errors were encountered: