Avoid panics during shutdown routine

This commit is contained in:
freddygv 2020-07-30 11:13:40 -06:00
parent 5658faec6b
commit b5e858d3e1
1 changed files with 6 additions and 2 deletions

View File

@ -958,9 +958,13 @@ func (s *Server) Shutdown() error {
}
// Close the connection pool
s.connPool.Shutdown()
if s.connPool != nil {
s.connPool.Shutdown()
}
s.acls.Close()
if s.acls != nil {
s.acls.Close()
}
if s.config.NotifyShutdown != nil {
s.config.NotifyShutdown()