diff options
author | Julien Dessaux | 2025-01-03 23:31:43 +0100 |
---|---|---|
committer | Julien Dessaux | 2025-01-03 23:31:43 +0100 |
commit | 63e2b1b09dd2b98b372969d989254084a2b64ecb (patch) | |
tree | 9c92c6ef38cf3fdf3e7ce64d83daa8697aa0e843 | |
parent | chore(tfstated): refactor middlewares (diff) | |
download | tfstated-63e2b1b09dd2b98b372969d989254084a2b64ecb.tar.gz tfstated-63e2b1b09dd2b98b372969d989254084a2b64ecb.tar.bz2 tfstated-63e2b1b09dd2b98b372969d989254084a2b64ecb.zip |
feat(tfstated): add syscall.SIGTERM handling
-rw-r--r-- | cmd/tfstated/main.go | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |