Increment WaitGroup before launching advertiseEvents goroutine

This commit is contained in:
Milos Gajdos 2019-07-17 13:02:47 +01:00
parent 2803146673
commit 94b6455577
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -273,10 +273,8 @@ func (r *router) advertiseTable() error {
// advertise all routes as Update events to subscribers
if len(events) > 0 {
go func() {
r.advertWg.Add(1)
r.advertiseEvents(Update, events)
}()
r.advertWg.Add(1)
go r.advertiseEvents(Update, events)
}
case <-r.exit:
return nil