This commit is contained in:
wangchuxiao
2022-09-15 01:22:20 +08:00
parent 266a2b4c76
commit a1f79f4508
13 changed files with 187 additions and 26 deletions
+5 -2
View File
@@ -126,8 +126,11 @@ func (rpc *rpcAuth) Run() {
panic("listening err:" + err.Error() + rpc.rpcRegisterName)
}
log.NewInfo(operationID, "listen network success, ", address, listener)
//grpc server
srv := grpc.NewServer()
var grpcOpts []grpc.ServerOption
if config.Config.Prometheus.Enable {
grpcOpts = append(grpcOpts, promePkg.UnaryServerInterceptorProme)
}
srv := grpc.NewServer(grpcOpts...)
defer srv.GracefulStop()
//service registers with etcd