Skip to content

Commit

Permalink
[release/0.3] Stop gracefully on SIGTERM (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi authored Oct 18, 2023
1 parent 039eeac commit b347b8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/signal"
"strings"
"syscall"
"time"

"github.com/gofiber/fiber/v2"
Expand Down Expand Up @@ -102,7 +103,7 @@ func serverCmd(cmd *cobra.Command, args []string) error {
isRunning := make(chan struct{})
go func() {
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, os.Interrupt)
signal.Notify(sigint, os.Interrupt, syscall.SIGTERM)
<-sigint

log.Infof("Shutting down")
Expand Down

0 comments on commit b347b8f

Please sign in to comment.