diff --git a/ticker/ticker.go b/ticker/ticker.go index 1a0f57c..811374e 100644 --- a/ticker/ticker.go +++ b/ticker/ticker.go @@ -255,7 +255,7 @@ func (t *Ticker) ServeWithContext(ctx context.Context) { // If its a reconnect then wait exponentially based on reconnect attempt if t.reconnectAttempt > 0 { nextDelay := time.Duration(math.Pow(2, float64(t.reconnectAttempt))) * time.Second - if nextDelay > t.reconnectMaxDelay { + if nextDelay > t.reconnectMaxDelay || nextDelay <= 0 { nextDelay = t.reconnectMaxDelay }