lib/promscrape/discovery: remove superflouos check in registerPendingAPIWatchers

The check `_, ok := uw.aws[aw]; !ok` isn't needed, since aw cannot exist in uw.aws
because of the check inside subscribeAPIWatcher
This commit is contained in:
Aliaksandr Valialkin 2021-04-07 13:07:36 +03:00
parent 3ec6639bbb
commit 59f9960992

View file

@ -437,9 +437,7 @@ func (uw *urlWatcher) registerPendingAPIWatchers() {
for aw := range uw.awsPending {
awsPending = append(awsPending, aw)
delete(uw.awsPending, aw)
if _, ok := uw.aws[aw]; !ok {
uw.aws[aw] = struct{}{}
}
uw.aws[aw] = struct{}{}
}
uw.reloadScrapeWorksForAPIWatchers(awsPending, uw.objectsByKey)
uw.mu.Unlock()