Skip to content

Commit

Permalink
Set context timeout to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
jayme-github committed Jun 24, 2019
1 parent 8448041 commit eb7fdc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"os/exec"
"regexp"
"strconv"
"time"

"github.com/prometheus/client_golang/prometheus"
)
Expand Down Expand Up @@ -145,7 +146,7 @@ ParseEachOutputLine:
}

func callConntrackTool() ([]string, error) {
ctx, cancel := context.WithTimeout(context.Background(), 3e9)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, "conntrack", "--stats")
Expand Down

0 comments on commit eb7fdc3

Please sign in to comment.