Skip to content

Commit

Permalink
Merge pull request nsqio#15 from hailocab/fix-lookup-err
Browse files Browse the repository at this point in the history
Fix bounds err when removing lookupds.
  • Loading branch information
mreiferson committed Jan 30, 2015
2 parents 514cbea + 16845ac commit d2f55f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ exit:
// keeping track of which one was last used
func (r *Consumer) nextLookupdEndpoint() string {
r.mtx.RLock()
if r.lookupdQueryIndex >= len(r.lookupdHTTPAddrs) {
r.lookupdQueryIndex = 0
}
addr := r.lookupdHTTPAddrs[r.lookupdQueryIndex]
num := len(r.lookupdHTTPAddrs)
r.mtx.RUnlock()
Expand Down

0 comments on commit d2f55f5

Please sign in to comment.