diff --git a/consumer.go b/consumer.go index 3a6ada93..7a4203cb 100644 --- a/consumer.go +++ b/consumer.go @@ -496,7 +496,9 @@ func (r *Consumer) ConnectToNSQD(addr string) error { if !pendingOk { r.pendingConnections[addr] = conn } - r.nsqdTCPAddrs = append(r.nsqdTCPAddrs, addr) + if idx := indexOf(addr, r.nsqdTCPAddrs); idx == -1 { + r.nsqdTCPAddrs = append(r.nsqdTCPAddrs, addr) + } r.mtx.Unlock() r.log(LogLevelInfo, "(%s) connecting to nsqd", addr)