Merge pull request #417 from unistack-org/gossip

registry: [gossip] fix panic
This commit is contained in:
Asim Aslam 2019-02-13 13:41:28 +00:00 committed by GitHub
commit c3722877c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,9 +561,11 @@ func (g *gossipRegistry) run() {
case <-ticker.C: case <-ticker.C:
var addrs []string var addrs []string
g.RLock() g.RLock()
for node, action := range g.members { if g.member != nil {
if action == nodeActionLeave && g.member.LocalNode().Address() != node { for node, action := range g.members {
addrs = append(addrs, node) if action == nodeActionLeave && g.member.LocalNode().Address() != node {
addrs = append(addrs, node)
}
} }
} }
g.RUnlock() g.RUnlock()