Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/facebookgo/grace
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy R. Fishman committed Dec 1, 2016
2 parents 19fccdb + 5729e48 commit b07a63a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language: go

go:
- 1.4
- 1.7

before_install:
- go get -v golang.org/x/tools/cmd/vet
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/golang/lint/golint

install:
Expand Down
6 changes: 3 additions & 3 deletions gracehttp/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func (a *App) term(wg *sync.WaitGroup) {

func (a *App) signalHandler(wg *sync.WaitGroup) {
ch := make(chan os.Signal, 10)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGUSR2)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR2)
for {
sig := <-ch
switch sig {
case syscall.SIGTERM:
// this ensures a subsequent TERM will trigger standard go behaviour of
case syscall.SIGINT, syscall.SIGTERM:
// this ensures a subsequent INT/TERM will trigger standard go behaviour of
// terminating.
signal.Stop(ch)
a.term(wg)
Expand Down

0 comments on commit b07a63a

Please sign in to comment.