From 21922d43202954189aaceb8661049e1615cb9a17 Mon Sep 17 00:00:00 2001 From: Olof Salberger Date: Thu, 23 May 2024 09:06:38 +0200 Subject: [PATCH] Add sigterm to interupt signals list --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 709939e..8499ccd 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( "os" "os/signal" "runtime/debug" + "syscall" _ "github.com/mattn/go-sqlite3" "github.com/robfig/cron/v3" @@ -42,7 +43,7 @@ func makeJobs(cronfile string, databasefile string, logger *log.Logger, monitor } func run(ctx context.Context, w io.Writer, logger *log.Logger, webport int, check bool, crontab, databases, historyfile string, args []string) error { - ctx, stop := signal.NotifyContext(ctx, os.Interrupt) + ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM) defer stop() db, err := sql.Open("sqlite3", historyfile) if err != nil {