[ 
https://issues.apache.org/jira/browse/SCB-473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433318#comment-16433318
 ] 

ASF GitHub Bot commented on SCB-473:
------------------------------------

little-cui closed pull request #326: SCB-473 delete service, should delete 
dependency key
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/326
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/service/util/dependency.go 
b/server/service/util/dependency.go
index 66261163..3c912564 100644
--- a/server/service/util/dependency.go
+++ b/server/service/util/dependency.go
@@ -644,6 +644,18 @@ func (dep *Dependency) addConsumerOfProviderRule() {
 }
 
 func (dep *Dependency) UpdateProvidersRuleOfConsumer(conKey string) error {
+       if len(dep.ProvidersRule) == 0 {
+               _, err := backend.Registry().Do(context.TODO(),
+                       registry.DEL,
+                       registry.WithStrKey(conKey),
+                       )
+               if err != nil {
+                       util.Logger().Errorf(nil, "Upload dependency rule 
failed.")
+                       return err
+               }
+               return nil
+       }
+
        dependency := &pb.MicroServiceDependency{
                Dependency: dep.ProvidersRule,
        }
diff --git a/server/service/util/instance_util.go 
b/server/service/util/instance_util.go
index 5c373a95..c45845d7 100644
--- a/server/service/util/instance_util.go
+++ b/server/service/util/instance_util.go
@@ -279,4 +279,4 @@ func UpdateInstance(ctx context.Context, domainProject 
string, instance *pb.Micr
                return scerr.NewError(scerr.ErrInternal, err.Error())
        }
        return nil
-}
\ No newline at end of file
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> delete service, should delete dependency key
> --------------------------------------------
>
>                 Key: SCB-473
>                 URL: https://issues.apache.org/jira/browse/SCB-473
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Service-Center
>    Affects Versions: service-center-1.0.0-m1
>            Reporter: aseTo2016
>            Assignee: little-cui
>            Priority: Major
>             Fix For: service-center-1.0.0-m2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to