// WithPeriodicCheck adds a new health check that contributes to the overall service availability status.
// The health check will be performed on a fixed schedule and will not be executed for each HTTP request
// (as in contrast to WithCheck). This allows to process a much higher number of HTTP requests without
// actually calling the checked services too often or to execute long running checks.
// This way Checker.Check (and the health endpoint) always returns the last result of the periodic check.
WithPeriodicCheck adds a new health check that contributes to the overall service availability status.
The health check will be performed on a fixed schedule and will not be executed for each HTTP request
(as in contrast to WithCheck). This allows to process a much higher number of HTTP requests without
actually calling the checked services too often or to execute long running checks.
This way Checker.Check (and the health endpoint) always returns the last result of the periodic check.
// WithPeriodicCheck adds a new health check that contributes to the overall service availability status . // The health check will be performed on a fixed schedule and will not be executed for each HTTP request // ( as in contrast to WithCheck ) . This allows to process a much higher number of HTTP requests without // actually calling the checked services too often or to execute long running checks . // This way Checker . Check ( and the health endpoint ) always returns the last result of the periodic check .
func WithPeriodicCheck(refreshPeriod time.Duration, initialDelay time.Duration, check Check) CheckerOption {
	return func(cfg *checkerConfig) {
		check.updateInterval = refreshPeriod
		check.initialDelay = initialDelay
		cfg.checks[check.Name] = &check
	}
}
func WithPeriodicCheck ( refreshPeriod time . Duration , initialDelay time . Duration , check Check ) CheckerOption { return func ( cfg * checkerConfig ) { check . updateInterval = refreshPeriod check . initialDelay = initialDelay cfg . checks [ check . Name ] = & check } }
WithPeriodicCheck adds a new health check that contributes to the overall service availability status.
WithPeriodicCheck adds a new health check that contributes to the overall service availability status .