Skip to content

Commit

Permalink
set default execution period to avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarkhas committed Jun 7, 2021
1 parent 0d5b280 commit 90f9fe5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func WithHealthListeners(listener ...HealthListener) HealthOption {
// WithDefaults sets all the Health object settings. It's not required to use this as no options is always default
// This is a simple placeholder for any future defaults
func WithDefaults() HealthOption {
return healthOptionFunc(func(h *health) {})
return healthOptionFunc(func(h *health) {
if h.defaultExecutionPeriod == 0 {
h.defaultExecutionPeriod = 1 * time.Minute
}
})
}

// CheckOption configures a health check using the functional options paradigm
Expand Down

0 comments on commit 90f9fe5

Please sign in to comment.