From 5328506c3e8e466ed1509b1ad1d0a2004c045f26 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 1 Mar 2021 12:12:56 +0200 Subject: [PATCH] lib/promscrape: typo fix, which prevented from caching ScrapeWork entries --- lib/promscrape/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/promscrape/config.go b/lib/promscrape/config.go index 28e5959c6..dc32daf2a 100644 --- a/lib/promscrape/config.go +++ b/lib/promscrape/config.go @@ -737,7 +737,7 @@ func (swc *scrapeWorkConfig) getScrapeWork(target string, extraLabels, metaLabel return sw, nil } sw, err := swc.getScrapeWorkReal(target, extraLabels, metaLabels) - if err != nil { + if err == nil { swc.cache.Set(string(bb.B), sw) } return sw, err