Skip to content

Commit

Permalink
Fix duplicates in registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed Oct 13, 2013
1 parent d3b064c commit ec24e76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (r *Registry) URLs(leaderName, selfName string) []string {
if e, _ := r.store.Get(RegistryKey, false, false, 0, 0); e != nil {
// Lookup the URL for each one.
for _, pair := range e.KVPairs {
if url, _ := r.url(pair.Key); len(url) > 0 {
if url, _ := r.url(pair.Key); len(url) > 0 && pair.Key != leaderName && pair.Key != selfName {
urls = append(urls, url)
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func (r *Registry) PeerURLs(leaderName, selfName string) []string {
if e, _ := r.store.Get(RegistryKey, false, false, 0, 0); e != nil {
// Lookup the URL for each one.
for _, pair := range e.KVPairs {
if url, _ := r.peerURL(pair.Key); len(url) > 0 {
if url, _ := r.peerURL(pair.Key); len(url) > 0 && pair.Key != leaderName && pair.Key != selfName {
urls = append(urls, url)
}
}
Expand Down

0 comments on commit ec24e76

Please sign in to comment.