From 63e2b1b09dd2b98b372969d989254084a2b64ecb Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 3 Jan 2025 23:31:43 +0100 Subject: feat(tfstated): add syscall.SIGTERM handling --- cmd/tfstated/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tfstated/main.go b/cmd/tfstated/main.go index a1c74ca..e228d53 100644 --- a/cmd/tfstated/main.go +++ b/cmd/tfstated/main.go @@ -7,6 +7,7 @@ import ( "os" "os/signal" "sync" + "syscall" "time" "git.adyxax.org/adyxax/tfstated/pkg/backend" @@ -19,7 +20,7 @@ func run( db *database.DB, getenv func(string) string, ) error { - ctx, cancel := signal.NotifyContext(ctx, os.Interrupt) + ctx, cancel := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM) defer cancel() if err := db.InitAdminAccount(); err != nil { -- cgit v1.2.3