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



##########
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的原因是成功的时候不需要打印吗?性能优化?




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