Explorar el Código

update

master
DengBiao hace 1 año
padre
commit
9b421e6769
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. +9
    -1
      cmd/business/main.go

+ 9
- 1
cmd/business/main.go Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar