From 0abec555160d0fed3977e0c6a9bb9baeb9ee2ee8 Mon Sep 17 00:00:00 2001 From: Christian Niehoff Date: Mon, 27 Jan 2025 12:39:47 +0100 Subject: [PATCH] feat: catching SIGINT and SIGTERM now --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 0c02a9b..17e0b5c 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,7 @@ import ( "os" "os/signal" "strings" + "syscall" "time" "github.com/prometheus/client_golang/prometheus" @@ -71,7 +72,8 @@ func main() { done := make(chan bool) quit := make(chan os.Signal, 1) - signal.Notify(quit, os.Interrupt) + // catch SIGTERM or SIGINT + signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) go func() { <-quit