mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
fix buf redeclared in scrapeloop (#4873)
* buf Has been declared in scrape.go in line 785, I think it is unnecessary to declare a new variable again here. Signed-off-by: arugakiWei <arugaki.wei@daocloud.io> * delete the buf in line 785 because it is never used. Signed-off-by: arugakiWei <arugaki.wei@daocloud.io>
This commit is contained in:
parent
bd100182b2
commit
b98a5acb57
|
@ -781,11 +781,8 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) {
|
|||
ticker := time.NewTicker(interval)
|
||||
defer ticker.Stop()
|
||||
|
||||
buf := bytes.NewBuffer(make([]byte, 0, 16000))
|
||||
|
||||
mainLoop:
|
||||
for {
|
||||
buf.Reset()
|
||||
select {
|
||||
case <-sl.ctx.Done():
|
||||
close(sl.stopped)
|
||||
|
|
Loading…
Reference in a new issue