This commit is contained in:
withchao
2023-03-07 16:57:49 +08:00
parent 555fc52acc
commit 102ab98276
17 changed files with 139 additions and 276 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import (
"OpenIM/pkg/common/config"
"OpenIM/pkg/common/constant"
"OpenIM/pkg/common/log"
"OpenIM/pkg/common/middleware"
"OpenIM/pkg/common/mw"
"OpenIM/pkg/common/prome"
"OpenIM/pkg/discoveryregistry"
"flag"
@@ -36,7 +36,7 @@ func start(rpcPort int, rpcRegisterName string, prometheusPorts int, rpcFn func(
if err != nil {
return err
}
options = append(options, grpc.UnaryInterceptor(middleware.RpcServerInterceptor)) // ctx 中间件
options = append(options, mw.GrpcServer()) // ctx 中间件
if config.Config.Prometheus.Enable {
prome.NewGrpcRequestCounter()
prome.NewGrpcRequestFailedCounter()