tianxiaoliang commented on a change in pull request #809:
URL: 
https://github.com/apache/servicecomb-service-center/pull/809#discussion_r555035035



##########
File path: datasource/mongo/ms.go
##########
@@ -1570,23 +1570,31 @@ func (ds *DataSource) GetInstance(ctx context.Context, 
request *discovery.GetOne
        }
 
        domainProject := util.ParseDomainProject(ctx)
-       services, err := findServices(ctx, 
discovery.MicroServiceToKey(domainProject, provider.ServiceInfo))
+       services, exist, err := findServices(ctx, 
discovery.MicroServiceToKey(domainProject, provider.ServiceInfo))
        if err != nil {
                log.Error(fmt.Sprintf("get instance failed %s", findFlag()), 
err)
                return &discovery.GetOneInstanceResponse{
                        Response: 
discovery.CreateResponse(discovery.ErrInternal, err.Error()),
                }, err
        }
+       if services == nil && exist {
+               if exist {
+                       return &discovery.GetOneInstanceResponse{
+                               Response: 
discovery.CreateResponse(discovery.ResponseSuccess, "Get instance 
successfully."),
+                               Instance: nil,
+                       }, nil
+               } else {

Review comment:
       1586永远跑不到




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