Skip to content

Commit 55e9cb6

Browse files
committed
Terminate on TERM signal
1 parent fa67382 commit 55e9cb6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

termination.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package hc
33
import (
44
"os"
55
"os/signal"
6+
"syscall"
67
)
78

89
// TermFunc defines the function which is executed on termination.
@@ -13,6 +14,7 @@ func OnTermination(fn TermFunc) {
1314
c := make(chan os.Signal)
1415
signal.Notify(c, os.Interrupt)
1516
signal.Notify(c, os.Kill)
17+
signal.Notify(c, syscall.SIGTERM)
1618

1719
go func() {
1820
select {

0 commit comments

Comments
 (0)