Improve timeout in input plugins

This commit is contained in:
Pierre Fersing
2016-03-01 09:43:28 +00:00
committed by Cameron Sparr
parent ea7cbc781e
commit 7416d6ea71
21 changed files with 184 additions and 21 deletions
+3
View File
@@ -67,6 +67,9 @@ func (z *Zookeeper) gatherServer(address string, acc telegraf.Accumulator) error
}
defer c.Close()
// Extend connection
c.SetDeadline(time.Now().Add(defaultTimeout))
fmt.Fprintf(c, "%s\n", "mntr")
rdr := bufio.NewReader(c)
scanner := bufio.NewScanner(rdr)