1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-30 08:06:40 +02:00

Merge pull request #472 from unistack-org/gossip2

fix race with rcache
This commit is contained in:
Asim Aslam 2019-05-09 21:24:27 +01:00 committed by GitHub
commit 4f5ff076d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,9 @@ func (m *gossipWatcher) Next() (*registry.Result, error) {
if len(m.wo.Service) > 0 && r.Service.Name != m.wo.Service {
continue
}
return r, nil
nr := &registry.Result{}
*nr = *r
return nr, nil
case <-m.stop:
return nil, registry.ErrWatcherStopped
}