mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Merge pull request #1064 from andyxning/check_for_monitor_server_start_error
check for monitor server start error
This commit is contained in:
@@ -1471,7 +1471,14 @@ func (s *Server) startMonitoring(secure bool) error {
|
||||
s.mu.Unlock()
|
||||
|
||||
go func() {
|
||||
srv.Serve(httpListener)
|
||||
if err := srv.Serve(httpListener); err != nil {
|
||||
s.mu.Lock()
|
||||
shutdown := s.shutdown
|
||||
s.mu.Unlock()
|
||||
if !shutdown {
|
||||
s.Fatalf("Error starting monitor on %q: %v", hp, err)
|
||||
}
|
||||
}
|
||||
srv.Handler = nil
|
||||
s.mu.Lock()
|
||||
s.httpHandler = nil
|
||||
|
||||
Reference in New Issue
Block a user