From 49ab7946c71a7eb824d43048340accda875ebe0d Mon Sep 17 00:00:00 2001 From: "J. David Lee" Date: Thu, 27 Jun 2019 21:41:05 +0200 Subject: [PATCH] Souce can only be timed out if timeout is non-zero. --- types.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types.go b/types.go index d9f6db5..6a588d7 100644 --- a/types.go +++ b/types.go @@ -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 {