Skip to content

Commit

Permalink
Add handling of terminal OS signals
Browse files Browse the repository at this point in the history
  • Loading branch information
mAdkins committed Jun 26, 2023
1 parent 57e14fe commit 977a2b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tester/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ func main() {
msgLogger = message.NewLogger(flagSet, logManager)
terminator = app.NewTerminator()
terminator.Add(lsp.NewTerminator())
app.HandleTerminalSignals(func(sig os.Signal) {
log.Warn().Str("signal", sig.String()).Msg("Terminal OS signal received")
if err := terminator.Shutdown(); err != nil {
log.Error().Err(err).Msg("Terminating")
}
})

var listener *tcp.Listener
switch flagSet.Protocol() {
Expand Down

0 comments on commit 977a2b3

Please sign in to comment.