This commit is contained in:
lwl0608 2024-05-17 11:38:43 +08:00
parent 1a19cc2f08
commit 466916376e
1 changed files with 1 additions and 1 deletions

View File

@ -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 ...")