From 76f1e50d5095b9d5c634b015e64fa2c8cc63ed31 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Thu, 17 Sep 2020 12:54:48 +0300 Subject: [PATCH] Do not use retry backoff in PubSub --- pubsub.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pubsub.go b/pubsub.go index 936fc5d8..c56270b4 100644 --- a/pubsub.go +++ b/pubsub.go @@ -528,7 +528,7 @@ func (c *PubSub) initMsgChan(size int) { return } if errCount > 0 { - time.Sleep(c.retryBackoff(errCount)) + time.Sleep(100 * time.Millisecond) } errCount++ continue @@ -586,7 +586,7 @@ func (c *PubSub) initAllChan(size int) { return } if errCount > 0 { - time.Sleep(c.retryBackoff(errCount)) + time.Sleep(100 * time.Millisecond) } errCount++ 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) } } - -func (c *PubSub) retryBackoff(attempt int) time.Duration { - return internal.RetryBackoff(attempt, c.opt.MinRetryBackoff, c.opt.MaxRetryBackoff) -}