internal: add signal handler for SIGTERM
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
cf5771dad3
commit
9e1a518689
|
@ -4,6 +4,7 @@ import (
|
|||
"math/rand"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
|
@ -13,6 +14,8 @@ func Init() chan os.Signal {
|
|||
rand.Seed(time.Now().UnixNano())
|
||||
interrupt := make(chan os.Signal, 1)
|
||||
signal.Notify(interrupt, os.Interrupt)
|
||||
signal.Notify(interrupt, syscall.SIGINT)
|
||||
signal.Notify(interrupt, syscall.SIGTERM)
|
||||
return interrupt
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue