Souce can only be timed out if timeout is non-zero.

master v1.0.0
J. David Lee 2019-06-27 21:41:05 +02:00
parent 0b62cbd57d
commit 49ab7946c7
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ type Source struct {
}
func (s Source) TimedOut() bool {
return time.Since(s.LastSeenAt) > time.Duration(s.AlertTimeout)*time.Second
return s.AlertTimeout != 0 &&
time.Since(s.LastSeenAt) > time.Duration(s.AlertTimeout)*time.Second
}
func (s Source) RequiresAlertForTimeout() bool {