mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -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)
|
ticker := time.NewTicker(interval)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
buf := bytes.NewBuffer(make([]byte, 0, 16000))
|
|
||||||
|
|
||||||
mainLoop:
|
mainLoop:
|
||||||
for {
|
for {
|
||||||
buf.Reset()
|
|
||||||
select {
|
select {
|
||||||
case <-sl.ctx.Done():
|
case <-sl.ctx.Done():
|
||||||
close(sl.stopped)
|
close(sl.stopped)
|
||||||
|
|
Loading…
Reference in a new issue