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"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/getsentry/sentry-go"
|
"github.com/getsentry/sentry-go"
|
||||||
|
@ -13,6 +14,8 @@ func Init() chan os.Signal {
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
interrupt := make(chan os.Signal, 1)
|
interrupt := make(chan os.Signal, 1)
|
||||||
signal.Notify(interrupt, os.Interrupt)
|
signal.Notify(interrupt, os.Interrupt)
|
||||||
|
signal.Notify(interrupt, syscall.SIGINT)
|
||||||
|
signal.Notify(interrupt, syscall.SIGTERM)
|
||||||
return interrupt
|
return interrupt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue