prevent leakages by exiting gracefully with SIGTERM (#4352) (#4845)
Some checks failed
code_lint / golangci_lint (push) Has been cancelled
code_lint / mod_tidy (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled

This commit is contained in:
Alessandro Ros 2025-08-09 20:19:59 +02:00 committed by GitHub
parent d0430d8ea5
commit 2660e9629f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,9 @@ import (
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"reflect" "reflect"
"runtime"
"strings" "strings"
"syscall"
"time" "time"
"github.com/alecthomas/kong" "github.com/alecthomas/kong"
@ -191,6 +193,9 @@ func (p *Core) run() {
interrupt := make(chan os.Signal, 1) interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt) signal.Notify(interrupt, os.Interrupt)
if runtime.GOOS == "linux" {
signal.Notify(interrupt, syscall.SIGTERM)
}
outer: outer:
for { for {