Replace the only parentCtx with appCtx

If this doesn't cause the memory increase then the retention is in
`sl.ctx`

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
This commit is contained in:
Goutham Veeramachaneni 2022-04-27 05:54:31 -07:00
parent e59f35baa6
commit 519930a61b
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD

View File

@ -1288,7 +1288,7 @@ func (sl *scrapeLoop) scrapeAndReport(last, appendTime time.Time, errc chan<- er
}
var contentType string
scrapeCtx, cancel := context.WithTimeout(sl.parentCtx, sl.timeout)
scrapeCtx, cancel := context.WithTimeout(sl.appCtx, sl.timeout)
contentType, scrapeErr = sl.scraper.scrape(scrapeCtx, buf)
cancel()