示例#1
0
// CheckHealth runs the service's health command, returning the results
func (s *Service) CheckHealth() error {

	// if we have a valid Service but there's no health check
	// set, assume it always passes (ex. telemetry service).
	if s.healthCheckCmd == nil {
		return nil
	}
	return commands.RunWithTimeout(s.healthCheckCmd, log.Fields{
		"process": "health", "serviceName": s.Name, "serviceID": s.ID})
}
示例#2
0
// OnChange runs the backend's onChange command, returning the results
func (b *Backend) OnChange() error {
	return commands.RunWithTimeout(b.onChangeCmd, log.Fields{
		"process": "onChange", "backend": b.Name})
}
示例#3
0
// PollAction runs the task
func (t *Task) PollAction() {
	fields := log.Fields{"process": "task", "task": t.Name}
	commands.RunWithTimeout(t.cmd, fields)
}