diff --git a/library/httpserver/httpserver.go b/library/httpserver/httpserver.go index 8d33a2ac..90be0c2b 100644 --- a/library/httpserver/httpserver.go +++ b/library/httpserver/httpserver.go @@ -22,7 +22,6 @@ const ( func StartHttpServer(srv *http.Server, cfg *configcenter.DefaultConfig, ip string, port int) { quit := make(chan os.Signal) - signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) go func() { if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { @@ -43,6 +42,7 @@ func StartHttpServer(srv *http.Server, cfg *configcenter.DefaultConfig, ip strin setServerStatusFD(ServerStatusFDRun) }() + signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit logger.Info("Shutdown Server ...")