Skip to content

Commit 45d862c

Browse files
committed
improvements
1 parent 511a231 commit 45d862c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func main() {
4444
}
4545
app := cmd.NewMainApp(cmd.AppVersion{Version: Version, Extra: formatBuiltWith()})
4646
_ = cmd.RunMainApp(app, os.Args...) // all errors should have been handled by the RunMainApp
47-
log.GetManager().Close()
4847
}
4948

5049
func formatBuiltWith() string {

modules/graceful/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ func newWrappedListener(l net.Listener, srv *Server) *wrappedListener {
214214
}
215215

216216
func (wl *wrappedListener) Accept() (net.Conn, error) {
217+
if wl.server.getState() != stateRunning || wl.stopped {
218+
return nil, syscall.EINVAL
219+
}
220+
217221
var c net.Conn
218222
// Set keepalive on TCPListeners connections.
219223
if tcl, ok := wl.Listener.(*net.TCPListener); ok {

0 commit comments

Comments
 (0)