From 73a0e50ee16db54daabb02a2976190ee0b9ed327 Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Tue, 22 Jan 2019 10:43:46 -0800 Subject: [PATCH] Add dumb liveliness endpoint This currently returns 200 always. In the future we can add options for controling what constitues "liveliness" --- cmd/git-sync/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 419e842..f1ee82c 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -246,6 +246,9 @@ func main() { if *flHTTPMetrics { http.Handle("/metrics", promhttp.Handler()) } + // This is a dumb liveliness check endpoint. Currently this checks + // nothing and will always return 200 if the process is live. + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {}) http.Serve(ln, http.DefaultServeMux) }() }