コード例 #1
0
ファイル: services.go プロジェクト: joyent/containerpilot
// 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
ファイル: backends.go プロジェクト: joyent/containerpilot
// 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
ファイル: tasks.go プロジェクト: joyent/containerpilot
// PollAction runs the task
func (t *Task) PollAction() {
	fields := log.Fields{"process": "task", "task": t.Name}
	commands.RunWithTimeout(t.cmd, fields)
}