Skip to content

Commit

Permalink
refactor heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
almostinf committed Nov 5, 2024
1 parent d42af76 commit 0f76bdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion notifier/selfstate/heartbeat/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions notifier/selfstate/heartbeat/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0f76bdf

Please sign in to comment.