mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Better rate limited message.
This commit is contained in:
@ -233,9 +233,9 @@ func (c *PubSub) Receive() (interface{}, error) {
|
||||
return c.ReceiveTimeout(0)
|
||||
}
|
||||
|
||||
func (c *PubSub) reconnect() {
|
||||
func (c *PubSub) reconnect(reason error) {
|
||||
// Close current connection.
|
||||
c.connPool.(*stickyConnPool).Reset()
|
||||
c.connPool.(*stickyConnPool).Reset(reason)
|
||||
|
||||
if len(c.channels) > 0 {
|
||||
if err := c.Subscribe(c.channels...); err != nil {
|
||||
@ -276,7 +276,7 @@ func (c *PubSub) ReceiveMessage() (*Message, error) {
|
||||
if errNum > 2 {
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
c.reconnect()
|
||||
c.reconnect(err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user