mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Merge pull request #376 from martinlindhe/fix-goroutine-leak
Fix goroutine leak
This commit is contained in:
@@ -5,6 +5,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -144,6 +145,7 @@ func (coll WmiCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
go func() {
|
||||
wg.Wait()
|
||||
close(allDone)
|
||||
close(metricsBuffer)
|
||||
}()
|
||||
|
||||
// Wait until either all collectors finish, or timeout expires
|
||||
|
||||
Reference in New Issue
Block a user