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:
[email protected]
With regards,
Apache Git Services