From cf6cce277f39143cb0861c33920f2b692a67c8db Mon Sep 17 00:00:00 2001 From: Mathias Kaufmann Date: Sun, 22 Apr 2018 10:47:38 +0200 Subject: [PATCH] Use provided argument or fall-back for health-bind. The following arguments may used to specifiy health-check behavior: * `-healthcheck` : Enable healthcheck (default: `false`) * `-healthbind=[::1]:8086` : Override Healthcheck bind-address (default: `[::]:8086` Or use Environmentvariables `HEALTHCHECK` and `HEALTHBIND` --- goircd.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/goircd.go b/goircd.go index 2725269..a8b4576 100644 --- a/goircd.go +++ b/goircd.go @@ -207,13 +207,10 @@ func Run() { } func health_endpoint() { - var ( - health_bind = "0.0.0.0:8086" - ) health := healthchecking.NewHandler() health.AddLivenessCheck("goroutine-threshold", healthchecking.GoroutineCountCheck(100)) - log.Printf("Healthcheck listening on http://%s", health_bind) - http.ListenAndServe(health_bind, health) + log.Printf("Healthcheck listening on http://%s", *healtbind) + http.ListenAndServe(*healtbind, health) } func prom_export() {