Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Listen to SIGTERM
Browse files Browse the repository at this point in the history
  • Loading branch information
egonelbre committed Jan 24, 2019
1 parent 819969a commit 0da44fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gocode.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/signal"
"path/filepath"
"syscall"
)

var (
Expand Down Expand Up @@ -54,6 +55,7 @@ func cliContext() (context.Context, func()) {
sigs := make(chan os.Signal)
signal.Notify(sigs, os.Interrupt)
signal.Notify(sigs, os.Kill)
signal.Notify(sigs, syscall.SIGTERM)
go func() {
<-sigs
cancel()
Expand Down

0 comments on commit 0da44fc

Please sign in to comment.