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

Avoid locking on reading strategy for now

This commit is contained in:
Milos Gajdos 2019-10-09 18:19:48 +01:00
parent 837597fe6f
commit d5ce96da24
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -682,11 +682,7 @@ func (r *router) flushRouteEvents(evType EventType) ([]*Event, error) {
return nil, fmt.Errorf("failed listing routes: %s", err) return nil, fmt.Errorf("failed listing routes: %s", err)
} }
r.RLock() if r.options.Advertise == All {
advertStrategy := r.options.Advertise
r.RUnlock()
if advertStrategy == All {
// build a list of events to advertise // build a list of events to advertise
events := make([]*Event, len(routes)) events := make([]*Event, len(routes))
for i, route := range routes { for i, route := range routes {