Skip to content

Commit 76f1e50

Browse files
committed
Do not use retry backoff in PubSub
1 parent c89ef0a commit 76f1e50

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pubsub.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ func (c *PubSub) initMsgChan(size int) {
528528
return
529529
}
530530
if errCount > 0 {
531-
time.Sleep(c.retryBackoff(errCount))
531+
time.Sleep(100 * time.Millisecond)
532532
}
533533
errCount++
534534
continue
@@ -586,7 +586,7 @@ func (c *PubSub) initAllChan(size int) {
586586
return
587587
}
588588
if errCount > 0 {
589-
time.Sleep(c.retryBackoff(errCount))
589+
time.Sleep(100 * time.Millisecond)
590590
}
591591
errCount++
592592
continue
@@ -627,7 +627,3 @@ func (c *PubSub) sendMessage(msg interface{}, timer *time.Timer) {
627627
"redis: %s channel is full for %s (message is dropped)", c, pingTimeout)
628628
}
629629
}
630-
631-
func (c *PubSub) retryBackoff(attempt int) time.Duration {
632-
return internal.RetryBackoff(attempt, c.opt.MinRetryBackoff, c.opt.MaxRetryBackoff)
633-
}

0 commit comments

Comments
 (0)