Prevent startup if intervals are 0
(cherry picked from commit d8f7b76253
)
This commit is contained in:
parent
99650a20e3
commit
2a83f97546
|
@ -151,6 +151,16 @@ func reloadLoop(
|
||||||
log.Fatalf("E! Error: no inputs found, did you provide a valid config file?")
|
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)
|
ag, err := agent.NewAgent(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("E! " + err.Error())
|
log.Fatal("E! " + err.Error())
|
||||||
|
|
Loading…
Reference in New Issue