Prevent startup if intervals are 0

(cherry picked from commit d8f7b76253)
This commit is contained in:
Daniel Nelson 2017-07-17 11:58:47 -07:00
parent 99650a20e3
commit 2a83f97546
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 10 additions and 0 deletions

View File

@ -151,6 +151,16 @@ func reloadLoop(
log.Fatalf("E! Error: no inputs found, did you provide a valid config file?")
}
if int64(c.Agent.Interval.Duration) <= 0 {
log.Fatalf("E! Agent interval must be positive, found %s",
c.Agent.Interval.Duration)
}
if int64(c.Agent.FlushInterval.Duration) <= 0 {
log.Fatalf("E! Agent flush_interval must be positive; found %s",
c.Agent.Interval.Duration)
}
ag, err := agent.NewAgent(c)
if err != nil {
log.Fatal("E! " + err.Error())