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

Commit 082c302

Browse files
author
Bjørn
authored
Log os signals as info and exit with 0 (#28)
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.
1 parent 9bc0ed3 commit 082c302

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ func main() {
108108
go func() {
109109
select {
110110
case sig := <-sigs:
111-
done <- fmt.Errorf("received os signal '%s'", sig)
111+
log.Infof("Received os signal '%s'. Terminating...", sig)
112+
done <- nil
112113
}
113114
}()
114115

0 commit comments

Comments
 (0)