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