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)
}
r.RLock()
advertStrategy := r.options.Advertise
r.RUnlock()
if advertStrategy == All {
if r.options.Advertise == All {
// build a list of events to advertise
events := make([]*Event, len(routes))
for i, route := range routes {