Skip to content

Commit

Permalink
Merge pull request #104 from ryanslade/reconnect-bug
Browse files Browse the repository at this point in the history
consumer: Only add host address once on connection.
  • Loading branch information
mreiferson committed Jan 27, 2015
2 parents b221991 + 5ade92a commit a6112d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a6112d1

Please sign in to comment.