diff --git a/server/apiAdmin.go b/server/apiAdmin.go index 226a437..c4ac28e 100644 --- a/server/apiAdmin.go +++ b/server/apiAdmin.go @@ -76,15 +76,14 @@ func (s *webServer) Run(addr string, cli *client.QQClient) *coolq.CQBot { //通用路由 s.engine.Any("/admin/:action", s.admin) - if Debug { - pprof.Register(s.engine) - log.Debugf("pprof 性能分析服务已启动在 http://%v/debug/pprof, 如果有任何性能问题请下载报告并提交给开发者", addr) - time.Sleep(time.Second * 3) - } - go func() { //开启端口监听 if s.Conf.WebUi != nil && s.Conf.WebUi.Enabled { + if Debug { + pprof.Register(s.engine) + log.Debugf("pprof 性能分析服务已启动在 http://%v/debug/pprof, 如果有任何性能问题请下载报告并提交给开发者", addr) + time.Sleep(time.Second * 3) + } log.Infof("Admin API 服务器已启动: %v", addr) err := s.engine.Run(addr) if err != nil {