Prevent startup if intervals are 0
This commit is contained in:
parent
6edd848e4c
commit
99e5ccee6f
|
@ -153,6 +153,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