Merge pull request #10569 from zzJinux/discovery-manager-run
Fix discovery managers to be properly cancelled
This commit is contained in:
commit
4b735f02a6
|
@ -140,11 +140,9 @@ type Manager struct {
|
||||||
// Run starts the background processing
|
// Run starts the background processing
|
||||||
func (m *Manager) Run() error {
|
func (m *Manager) Run() error {
|
||||||
go m.sender()
|
go m.sender()
|
||||||
for range m.ctx.Done() {
|
<-m.ctx.Done()
|
||||||
m.cancelDiscoverers()
|
m.cancelDiscoverers()
|
||||||
return m.ctx.Err()
|
return m.ctx.Err()
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SyncCh returns a read only channel used by all the clients to receive target updates.
|
// SyncCh returns a read only channel used by all the clients to receive target updates.
|
||||||
|
|
|
@ -180,11 +180,9 @@ func (m *Manager) Providers() []*Provider {
|
||||||
// Run starts the background processing.
|
// Run starts the background processing.
|
||||||
func (m *Manager) Run() error {
|
func (m *Manager) Run() error {
|
||||||
go m.sender()
|
go m.sender()
|
||||||
for range m.ctx.Done() {
|
<-m.ctx.Done()
|
||||||
m.cancelDiscoverers()
|
m.cancelDiscoverers()
|
||||||
return m.ctx.Err()
|
return m.ctx.Err()
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SyncCh returns a read only channel used by all the clients to receive target updates.
|
// SyncCh returns a read only channel used by all the clients to receive target updates.
|
||||||
|
|
Loading…
Reference in New Issue