We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acd074c commit f25fb7eCopy full SHA for f25fb7e
1 file changed
internal/command/http_server.go
@@ -7,6 +7,7 @@ package command
7
import (
8
"context"
9
"net"
10
+ "net/http"
11
"time"
12
13
"github.com/gozix/di"
@@ -31,8 +32,13 @@ func NewHTTPServer(ctn di.Container) *cobra.Command {
31
32
logger.Info("Starting HTTP server", zap.String("addr", addr))
33
34
go func() {
- if err = e.Start(addr); err != nil {
35
+ runErr := e.Start(addr)
36
+ if runErr == http.ErrServerClosed {
37
logger.Info("Gracefully shutting down the HTTP server")
38
+ return
39
+ }
40
+ if runErr != nil {
41
+ logger.Error("Shutting down the HTTP server", zap.Error(runErr))
42
}
43
}()
44
0 commit comments