fix
This commit is contained in:
parent
1a19cc2f08
commit
466916376e
|
@ -22,7 +22,6 @@ const (
|
||||||
|
|
||||||
func StartHttpServer(srv *http.Server, cfg *configcenter.DefaultConfig, ip string, port int) {
|
func StartHttpServer(srv *http.Server, cfg *configcenter.DefaultConfig, ip string, port int) {
|
||||||
quit := make(chan os.Signal)
|
quit := make(chan os.Signal)
|
||||||
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
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)
|
setServerStatusFD(ServerStatusFDRun)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
||||||
<-quit
|
<-quit
|
||||||
logger.Info("Shutdown Server ...")
|
logger.Info("Shutdown Server ...")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue