:arrow_up:升级依赖以及添加一些环境变量
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
@@ -3,7 +3,10 @@ package http
|
||||
import (
|
||||
"fmt"
|
||||
"gitee.ltd/lxh/logger/log"
|
||||
"github.com/gin-contrib/pprof"
|
||||
"github.com/spf13/cast"
|
||||
"net/http"
|
||||
"os"
|
||||
"wireguard-ui/config"
|
||||
"wireguard-ui/http/router"
|
||||
)
|
||||
@@ -16,6 +19,10 @@ func Kernel() error {
|
||||
handler := router.InitRouter()
|
||||
addr := fmt.Sprintf(":%d", config.Config.Http.Port)
|
||||
|
||||
if cast.ToBool(os.Getenv("ENABLED_PPROF")) {
|
||||
pprof.Register(handler, "/monitoring")
|
||||
}
|
||||
|
||||
httpServer := http.Server{
|
||||
Addr: addr,
|
||||
Handler: handler,
|
||||
|
||||
Reference in New Issue
Block a user