瀏覽代碼

debug: add pprof in master process

Jacky 1 天之前
父節點
當前提交
ae8646ebfc
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      main.go

+ 7 - 0
main.go

@@ -4,11 +4,14 @@ import (
 	"context"
 	"crypto/tls"
 	"fmt"
+	"log"
 	"net"
 	"net/http"
 	"os/signal"
 	"syscall"
 
+	_ "net/http/pprof"
+
 	"github.com/0xJacky/Nginx-UI/internal/cert"
 	"github.com/0xJacky/Nginx-UI/internal/cmd"
 
@@ -103,6 +106,10 @@ func main() {
 	ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
 	defer cancel()
 
+	go func() {
+		log.Println(http.ListenAndServe(":6060", nil))
+	}()
+
 	err := risefront.New(ctx, risefront.Config{
 		Run:       Program(ctx, confPath),
 		Name:      "nginx-ui",