Fix vetting code

This commit is contained in:
Asim Aslam 2017-10-03 11:53:41 +01:00 committed by Vasiliy Tolstov
parent 5a88474e9a
commit 42ab4ca7b5

View File

@ -226,11 +226,11 @@ func (d *delegate) MergeRemoteState(buf []byte, join bool) {
func (m *gossipRegistry) publish(action string, services []*registry.Service) { func (m *gossipRegistry) publish(action string, services []*registry.Service) {
m.s.RLock() m.s.RLock()
for _, sub := range m.subs { for _, sub := range m.subs {
go func() { go func(sub chan *registry.Result) {
for _, service := range services { for _, service := range services {
sub <- &registry.Result{Action: action, Service: service} sub <- &registry.Result{Action: action, Service: service}
} }
}() }(sub)
} }
m.s.RUnlock() m.s.RUnlock()
} }