Source File
dial_retry_backoff.go
Belonging Package
github.com/redis/go-redis/v9
package redisimport ()// DialRetryBackoffConstant returns a dial retry backoff function that always returns d.// attempt is 0-based: attempt=0 is the delay after the 1st failed dial.func ( time.Duration) func( int) time.Duration {if < 0 {= 0}return func(int) time.Duration { return }}// DialRetryBackoffExponential returns a dial retry backoff function that uses exponential// backoff with jitter and a cap, using internal.RetryBackoff.//// attempt is 0-based: attempt=0 is the delay after the 1st failed dial.func (, time.Duration) func( int) time.Duration {if < 0 {= 0}if < 0 {= 0}if > {=}return func( int) time.Duration {// internal.RetryBackoff expects retry >= 0.if < 0 {= 0}return internal.RetryBackoff(, , )}}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |