The config map was never reset on applying a new config

This commit is contained in:
Krasi Georgiev 2018-01-14 19:41:53 +00:00
parent febebcd49a
commit a981b51900
1 changed files with 3 additions and 1 deletions

View File

@ -83,9 +83,11 @@ func (m *ScrapeManager) Stop() {
func (m *ScrapeManager) ApplyConfig(cfg *config.Config) error {
done := make(chan struct{})
m.actionCh <- func() {
c := make(map[string]*config.ScrapeConfig)
for _, scfg := range cfg.ScrapeConfigs {
m.scrapeConfigs[scfg.JobName] = scfg
c[scfg.JobName] = scfg
}
m.scrapeConfigs = c
close(done)
}
<-done