Skip to content

Commit

Permalink
Handle SIGTERM on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyqs committed Sep 1, 2021
1 parent 2539bbb commit 0865064
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/signal_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fmt"
"os"
"os/signal"
"syscall"
"time"

"golang.org/x/sys/windows/svc"
Expand All @@ -30,7 +31,7 @@ func (s *Server) handleSignals() {
}
c := make(chan os.Signal, 1)

signal.Notify(c, os.Interrupt)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)

go func() {
for sig := range c {
Expand Down

0 comments on commit 0865064

Please sign in to comment.