Skip to content

Commit

Permalink
Handle k8s sigterm (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly authored Feb 13, 2024
1 parent 11e773a commit 581a3cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scli.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os/signal"
"runtime"
"strings"
"syscall"
"time"

"fortio.org/cli"
Expand Down Expand Up @@ -130,7 +131,7 @@ func ServerMain() bool {
func UntilInterrupted() {
// listen for interrupt signal
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
// Block until a signal is received.
<-c
log.Warnf("Interrupt received.")
Expand Down

0 comments on commit 581a3cf

Please sign in to comment.