瀏覽代碼

update

master
DengBiao 1 年之前
父節點
當前提交
9b421e6769
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. +9
    -1
      cmd/business/main.go

+ 9
- 1
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)


Loading…
取消
儲存