From d5ce96da244b6c6675d56f5f44a7657a3650569f Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Wed, 9 Oct 2019 18:19:48 +0100 Subject: [PATCH] Avoid locking on reading strategy for now --- router/default.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/router/default.go b/router/default.go index b7845b8e..3c8f037e 100644 --- a/router/default.go +++ b/router/default.go @@ -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 {