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

fix race with rcache

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Vasiliy Tolstov 2019-05-09 23:01:58 +03:00
parent 8d21dd456c
commit 58775249c5

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
}