From 8576aa27e588fb90633d39ca6f32ef74db58fb09 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Sun, 18 Mar 2018 03:05:42 +0100 Subject: [PATCH] Added health check --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index a332ec2..94ee77c 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "fmt" "path/filepath" "time" + "net/http" ) func returnResult(config *Config, client *redis.Client, result Result) { @@ -84,4 +85,13 @@ func main() { go processImage(&config, client, value) } } + + http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("OK")) + }) + + err := http.ListenAndServe(":8080", nil) + if err != nil { + panic(err) + } } -- GitLab