mirror of https://github.com/go-redis/redis.git
Merge pull request #1494 from go-redis/fix/do-not-use-retry-backoff
Do not use retry backoff in PubSub
This commit is contained in:
commit
8f33c7c6b0
|
@ -528,7 +528,7 @@ func (c *PubSub) initMsgChan(size int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if errCount > 0 {
|
if errCount > 0 {
|
||||||
time.Sleep(c.retryBackoff(errCount))
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
errCount++
|
errCount++
|
||||||
continue
|
continue
|
||||||
|
@ -586,7 +586,7 @@ func (c *PubSub) initAllChan(size int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if errCount > 0 {
|
if errCount > 0 {
|
||||||
time.Sleep(c.retryBackoff(errCount))
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
errCount++
|
errCount++
|
||||||
continue
|
continue
|
||||||
|
@ -627,7 +627,3 @@ func (c *PubSub) sendMessage(msg interface{}, timer *time.Timer) {
|
||||||
"redis: %s channel is full for %s (message is dropped)", c, pingTimeout)
|
"redis: %s channel is full for %s (message is dropped)", c, pingTimeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PubSub) retryBackoff(attempt int) time.Duration {
|
|
||||||
return internal.RetryBackoff(attempt, c.opt.MinRetryBackoff, c.opt.MaxRetryBackoff)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue