AlexStocks commented on code in PR #3245:
URL: https://github.com/apache/dubbo-go/pull/3245#discussion_r2969157995


##########
remoting/etcdv3/client.go:
##########
@@ -68,7 +72,7 @@ func NewServiceDiscoveryClient(opts ...gxetcd.Option) 
*gxetcd.Client {
                opt(options)
        }
 
-       newClient, err := gxetcd.NewClient(options.Name, options.Endpoints, 
options.Timeout, options.Heartbeat)
+       newClient, err := gxetcd.NewClientWithOptions(context.Background(), 
options)

Review Comment:
   同上,硬编码 `context.Background()`。



##########
remoting/etcdv3/client.go:
##########
@@ -47,7 +51,7 @@ func ValidateClient(container clientFacade, opts 
...gxetcd.Option) error {
 
        // Client lose connection with etcd server
        if container.Client().GetRawClient() == nil {
-               newClient, err := gxetcd.NewClient(options.Name, 
options.Endpoints, options.Timeout, options.Heartbeat)
+               newClient, err := 
gxetcd.NewClientWithOptions(context.Background(), options)

Review Comment:
   同上,硬编码 `context.Background()`。



##########
remoting/etcdv3/client.go:
##########
@@ -36,7 +40,7 @@ func ValidateClient(container clientFacade, opts 
...gxetcd.Option) error {
 
        // new Client
        if container.Client() == nil {
-               newClient, err := gxetcd.NewClient(options.Name, 
options.Endpoints, options.Timeout, options.Heartbeat)
+               newClient, err := 
gxetcd.NewClientWithOptions(context.Background(), options)

Review Comment:
   这里硬编码了 `context.Background()`。建议使用 `context.TODO()` 表明这是临时的,或者考虑添加一个 context 
参数让调用者控制。



-- 
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]

Reply via email to