Skip to content

Commit

Permalink
Merge pull request #1523 from KoichiWada/handle-sigterm
Browse files Browse the repository at this point in the history
Handle SIGTERM for graceful shutdown.
  • Loading branch information
notzippy committed Mar 6, 2022
2 parents 942bd2e + 347610c commit 90489b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server_adapter_go.go
Expand Up @@ -13,6 +13,7 @@ import (
"sort"
"strconv"
"strings"
"syscall"
"time"

"github.com/revel/revel/utils"
Expand Down Expand Up @@ -216,7 +217,7 @@ func (g *GoHttpServer) Engine() interface{} {
func (g *GoHttpServer) Event(event Event, args interface{}) (r EventResponse) {
switch event {
case ENGINE_STARTED:
signal.Notify(g.signalChan, os.Interrupt, os.Kill)
signal.Notify(g.signalChan, os.Interrupt, syscall.SIGTERM, os.Kill)
go func() {
_ = <-g.signalChan
serverLogger.Info("Received quit singal Please wait ... ")
Expand Down

0 comments on commit 90489b1

Please sign in to comment.