Skip to content

Commit

Permalink
Merge pull request #376 from martinlindhe/fix-goroutine-leak
Browse files Browse the repository at this point in the history
Fix goroutine leak
  • Loading branch information
carlpett authored Aug 9, 2019
2 parents d01c669 + 6f6a479 commit 592c8a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package main
import (
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"sort"
"strconv"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 592c8a8

Please sign in to comment.