Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Log os signals as info and exit with 0 (#28)
Browse files Browse the repository at this point in the history
When receiving SIGINT or SIGTERM the application is expected to
terminate and thus not exit with 1.

This change makes the application log the signal and exit with 0.
  • Loading branch information
Bjørn authored Jul 15, 2019
1 parent 9bc0ed3 commit 082c302
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ func main() {
go func() {
select {
case sig := <-sigs:
done <- fmt.Errorf("received os signal '%s'", sig)
log.Infof("Received os signal '%s'. Terminating...", sig)
done <- nil
}
}()

Expand Down

0 comments on commit 082c302

Please sign in to comment.