|
@@ -4,6 +4,8 @@ import (
|
|
|
"eta/eta_api/controllers"
|
|
|
"eta/eta_api/services/alarm_msg"
|
|
|
"fmt"
|
|
|
+ "log"
|
|
|
+ "net/http"
|
|
|
"runtime"
|
|
|
"time"
|
|
|
|
|
@@ -14,6 +16,7 @@ import (
|
|
|
"github.com/beego/beego/v2/adapter/logs"
|
|
|
"github.com/beego/beego/v2/server/web"
|
|
|
"github.com/beego/beego/v2/server/web/context"
|
|
|
+ _ "net/http/pprof"
|
|
|
)
|
|
|
|
|
|
func main() {
|
|
@@ -23,6 +26,11 @@ func main() {
|
|
|
}
|
|
|
go services.Task()
|
|
|
|
|
|
+ // 启动pprof服务
|
|
|
+ go func() {
|
|
|
+ log.Println(http.ListenAndServe(":6060", nil))
|
|
|
+ }()
|
|
|
+
|
|
|
// 异常处理
|
|
|
web.ErrorController(&controllers.ErrorController{})
|
|
|
|