We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91d93ad commit ccac8b0Copy full SHA for ccac8b0
main.go
@@ -28,9 +28,9 @@ func main() {
28
ReadTimeout: 10 * time.Second,
29
}
30
31
- log.Printf("Server starting on port %s", port)
32
shutdownChannel := make(chan os.Signal, 10)
33
go func() {
+ log.Printf("Server starting on port %s", port)
34
err := httpServer.ListenAndServe()
35
if err != nil {
36
log.Printf("Server Error: %s", err)
@@ -45,4 +45,9 @@ func main() {
45
shutdownSignal := <-shutdownChannel
46
log.Printf("Received signal (%s), shutting down...", shutdownSignal.String())
47
httpServer.Shutdown(context.Background())
48
+
49
+ // Exit was not expected, return non 0 exit code
50
+ if shutdownSignal == syscall.SIGUSR1 {
51
+ os.Exit(1)
52
+ }
53
0 commit comments