trap sigterm instead of kill

main
jolheiser 2025-02-23 11:58:10 -06:00
parent a9208d2fe2
commit d4b287ed08
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"syscall"
"github.com/go-chi/chi/v5/middleware" "github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/httplog/v2" "github.com/go-chi/httplog/v2"
@ -111,7 +112,7 @@ func main() {
} }
ch := make(chan os.Signal, 1) ch := make(chan os.Signal, 1)
signal.Notify(ch, os.Kill, os.Interrupt) signal.Notify(ch, syscall.SIGTERM, os.Interrupt)
<-ch <-ch
} }