mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Fix discovery managers to be properly cancelled
Signed-off-by: Jinwook Jeong <vustthat@gmail.com>
This commit is contained in:
parent
6555cc68ca
commit
c7c7847b6f
|
@ -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.
|
||||||
|
|
|
@ -166,11 +166,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.
|
||||||
|
|
Loading…
Reference in a new issue