Do not register empty healthcheck urls
@@ -27,7 +27,8 @@ func NewOverviewHandler(repo api.Repository) func(w http.ResponseWriter, r *http
health.Reset()
for _, definition := range definitions {
- log.WithField("name", definition.Name).Debug("Health check registered")
+ if definition.HealthCheck.URL != "" {
+ log.WithField("name", definition.Name).Debug("Registering health check")
health.Register(health.Config{
Name: definition.Name,
Timeout: time.Second * time.Duration(definition.HealthCheck.Timeout),
@@ -35,6 +36,7 @@ func NewOverviewHandler(repo api.Repository) func(w http.ResponseWriter, r *http
Check: check(definition),
})
}
+ }
health.HandlerFunc(w, r)
}
