Explorar o código

Fix ExponentialReconnectionPolicy not incrementing correctly (#1374)

ExponentialReconnectionPolicy doesn't honor the number of retries made, since it uses the wrong argument for the attempt count.
Bahadır Kandemir %!s(int64=6) %!d(string=hai) anos
pai
achega
1982a06ad6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      policies.go

+ 1 - 1
policies.go

@@ -945,7 +945,7 @@ type ExponentialReconnectionPolicy struct {
 }
 
 func (e *ExponentialReconnectionPolicy) GetInterval(currentRetry int) time.Duration {
-	return getExponentialTime(e.InitialInterval, math.MaxInt16*time.Second, e.GetMaxRetries())
+	return getExponentialTime(e.InitialInterval, math.MaxInt16*time.Second, currentRetry)
 }
 
 func (e *ExponentialReconnectionPolicy) GetMaxRetries() int {