Fix discovery managers to be properly cancelled

Signed-off-by: Jinwook Jeong <vustthat@gmail.com>
pull/10569/head
Jinwook Jeong 3 years ago
parent 6555cc68ca
commit c7c7847b6f

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

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

Loading…
Cancel
Save