diff --git a/notifier/selfstate/heartbeat/database.go b/notifier/selfstate/heartbeat/database.go index 592325ef1..69ab7eed7 100644 --- a/notifier/selfstate/heartbeat/database.go +++ b/notifier/selfstate/heartbeat/database.go @@ -15,7 +15,7 @@ var _ Heartbeater = (*databaseHeartbeater)(nil) type DatabaseHeartbeaterConfig struct { HeartbeaterBaseConfig - RedisDisconnectDelay time.Duration `validate:"required,gt=0"` + RedisDisconnectDelay time.Duration `validate:"required_if=Enabled true,gte=0"` } type databaseHeartbeater struct { diff --git a/notifier/selfstate/heartbeat/heartbeat.go b/notifier/selfstate/heartbeat/heartbeat.go index 3a85f4094..b7fbedab3 100644 --- a/notifier/selfstate/heartbeat/heartbeat.go +++ b/notifier/selfstate/heartbeat/heartbeat.go @@ -15,8 +15,8 @@ const ( StateError State = "heartbeat_state_error" ) -// IsDegraded checks if the condition has degraded. -func (lastState State) IsDegraded(newState State) bool { +// IsDegraded checks if the condition is still degraded. +func (State) IsDegraded(newState State) bool { return newState == StateError }