Skip to content

Commit

Permalink
Use timeout smaller than 10 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreF committed Apr 4, 2016
1 parent 357849c commit b51473e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (m *MongoDB) gatherServer(server *Server, acc telegraf.Accumulator) error {
dialAddrs[0], err.Error())
}
dialInfo.Direct = true
dialInfo.Timeout = time.Duration(10) * time.Second
dialInfo.Timeout = time.Duration(8) * time.Second

if m.Ssl.Enabled {
tlsConfig := &tls.Config{}
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/mongodb/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func testSetup(m *testing.M) {
log.Fatalf("Unable to parse URL (%s), %s\n", dialAddrs[0], err.Error())
}
dialInfo.Direct = true
dialInfo.Timeout = time.Duration(10) * time.Second
dialInfo.Timeout = time.Duration(8) * time.Second
sess, err := mgo.DialWithInfo(dialInfo)
if err != nil {
log.Fatalf("Unable to connect to MongoDB, %s\n", err.Error())
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ func (p *Prometheus) gatherURL(url string, acc telegraf.Accumulator) error {

var rt http.RoundTripper = &http.Transport{
Dial: (&net.Dialer{
Timeout: 10 * time.Second,
Timeout: 8 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
TLSHandshakeTimeout: 8 * time.Second,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: p.InsecureSkipVerify,
},
Expand Down

0 comments on commit b51473e

Please sign in to comment.