Skip to content

Commit

Permalink
Merge pull request #2481 from nats-io/windows-syscall-sigterm
Browse files Browse the repository at this point in the history
Handle SIGTERM on windows (close window event)
  • Loading branch information
wallyqs authored Sep 1, 2021
2 parents 918aff0 + 75543e3 commit 219a7c9
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 219a7c9

Please sign in to comment.