feat: rpc add health check function configuration optional (#2288)

* feat: rpc add health check function configuration optional

* update config field name
This commit is contained in:
MarkJoyMa
2022-08-23 13:44:21 +08:00
committed by GitHub
parent 1c85d39add
commit 040c9e0954
4 changed files with 23 additions and 4 deletions

View File

@@ -35,9 +35,13 @@ type (
)
func newBaseRpcServer(address string, rpcServerOpts *rpcServerOptions) *baseRpcServer {
var h *health.Server
if rpcServerOpts.health {
h = health.NewServer()
}
return &baseRpcServer{
address: address,
health: health.NewServer(),
health: h,
metrics: rpcServerOpts.metrics,
options: []grpc.ServerOption{grpc.KeepaliveParams(keepalive.ServerParameters{
MaxConnectionIdle: defaultConnectionIdleDuration,