xzccfzy commented on a change in pull request #776:
URL: 
https://github.com/apache/servicecomb-service-center/pull/776#discussion_r540624855



##########
File path: datasource/mongo/ms.go
##########
@@ -1543,9 +1543,11 @@ func (ds *DataSource) GetInstances(ctx context.Context, 
request *pb.GetInstances
                }, nil
        }
 
-       findFlag := fmt.Sprintf("Consumer[%s][%s/%s/%s/%s] find 
provider[%s][%s/%s/%s/%s] instances",
-               request.ConsumerServiceId, service.ServiceInfo.Environment, 
service.ServiceInfo.AppId, service.ServiceInfo.ServiceName, 
service.ServiceInfo.Version,
-               provider.ServiceInfo.ServiceId, 
provider.ServiceInfo.Environment, provider.ServiceInfo.AppId, 
provider.ServiceInfo.ServiceName, provider.ServiceInfo.Version)
+       findFlag := func() string {
+               return fmt.Sprintf("Consumer[%s][%s/%s/%s/%s] find 
provider[%s][%s/%s/%s/%s] instances",
+                       request.ConsumerServiceId, 
service.ServiceInfo.Environment, service.ServiceInfo.AppId, 
service.ServiceInfo.ServiceName, service.ServiceInfo.Version,
+                       provider.ServiceInfo.ServiceId, 
provider.ServiceInfo.Environment, provider.ServiceInfo.AppId, 
provider.ServiceInfo.ServiceName, provider.ServiceInfo.Version)
+       }

Review comment:
       改成func是因为在使用curl调测时会因为请求参数不全导致panic,看了etcd那边是采用的func形式。




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to