chickenlj commented on code in PR #2502:
URL: https://github.com/apache/dubbo-go/pull/2502#discussion_r1399931890
##########
protocol/triple/health/triple_health/health.triple.go:
##########
@@ -94,22 +94,30 @@ type HealthImpl struct {
}
func (c *HealthImpl) Check(ctx context.Context, req *HealthCheckRequest, opts
...client.CallOption) (*HealthCheckResponse, error) {
+ opts = appendGroupVersion(opts, c)
resp := new(HealthCheckResponse)
- if err := c.cli.CallUnary(ctx, req, resp, "grpc.health.v1.Health",
"Check", c.group, c.version, opts...); err != nil {
+ if err := c.cli.CallUnary(ctx, req, resp, "grpc.health.v1.Health",
"Check", opts...); err != nil {
return nil, err
}
return resp, nil
}
func (c *HealthImpl) Watch(ctx context.Context, req *HealthCheckRequest, opts
...client.CallOption) (Health_WatchClient, error) {
- stream, err := c.cli.CallServerStream(ctx, req,
"grpc.health.v1.Health", "Watch", c.group, c.version, opts...)
+ opts = appendGroupVersion(opts, c)
+ stream, err := c.cli.CallServerStream(ctx, req,
"grpc.health.v1.Health", "Watch", opts...)
if err != nil {
return nil, err
}
rawStream := stream.(*triple_protocol.ServerStreamForClient)
return &HealthWatchClient{rawStream}, nil
}
+func appendGroupVersion(opts []client.CallOption, c *HealthImpl)
[]client.CallOption {
Review Comment:
Yeah, I have the same concern when implementing this feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]