Browse Source

Fix discovery managers to be properly cancelled

Signed-off-by: Jinwook Jeong <vustthat@gmail.com>
pull/10569/head
Jinwook Jeong 3 years ago
parent
commit
c7c7847b6f
  1. 8
      discovery/legacymanager/manager.go
  2. 8
      discovery/manager.go

8
discovery/legacymanager/manager.go

@ -140,11 +140,9 @@ type Manager struct {
// Run starts the background processing
func (m *Manager) Run() error {
go m.sender()
for range m.ctx.Done() {
m.cancelDiscoverers()
return m.ctx.Err()
}
return nil
<-m.ctx.Done()
m.cancelDiscoverers()
return m.ctx.Err()
}
// SyncCh returns a read only channel used by all the clients to receive target updates.

8
discovery/manager.go

@ -166,11 +166,9 @@ type Manager struct {
// Run starts the background processing.
func (m *Manager) Run() error {
go m.sender()
for range m.ctx.Done() {
m.cancelDiscoverers()
return m.ctx.Err()
}
return nil
<-m.ctx.Done()
m.cancelDiscoverers()
return m.ctx.Err()
}
// SyncCh returns a read only channel used by all the clients to receive target updates.

Loading…
Cancel
Save