Sfoglia il codice sorgente

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 6 anni fa
parent
commit
1982a06ad6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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 {