feat(tfstated): add syscall.SIGTERM handling
This commit is contained in:
parent
c18d03d404
commit
63e2b1b09d
1 changed files with 2 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue