From 14278190e34410ad0379b120b562f80737437d79 Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Fri, 4 Dec 2020 09:39:53 +0800 Subject: [PATCH] fix msg. --- server/apiAdmin.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 {