From 9b421e67692740b91d6facbda4b109d495b15e06 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 5 Dec 2022 17:34:10 +0800 Subject: [PATCH] update --- cmd/business/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/business/main.go b/cmd/business/main.go index 8852cae..f61d13e 100644 --- a/cmd/business/main.go +++ b/cmd/business/main.go @@ -9,8 +9,11 @@ import ( "gim/pkg/pb" "gim/pkg/urlwhitelist" "net" + "net/http" + _ "net/http/pprof" "os" "os/signal" + "runtime" "syscall" "go.uber.org/zap" @@ -18,7 +21,7 @@ import ( ) func main() { - config.Init() + //config.Init() db.Init() server := grpc.NewServer(grpc.UnaryInterceptor(interceptor.NewInterceptor("business_interceptor", urlwhitelist.Business))) @@ -31,6 +34,11 @@ func main() { server.GracefulStop() }() + runtime.SetBlockProfileRate(1) + go func() { + http.ListenAndServe(":10001", nil) + }() + pb.RegisterBusinessIntServer(server, &api.BusinessIntServer{}) pb.RegisterBusinessExtServer(server, &api.BusinessExtServer{}) listen, err := net.Listen("tcp", config.RPCListenAddr)