X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fregistry.go;h=5e9d63e900ce5a839bfa86df1bfa966403434526;hb=84662c4f3e2273152fc849f74880108b6346bcad;hp=f9e1bccb72ec5c5955a3c95ac2a488e185871f22;hpb=9c4697fa22fae79ac923e72f417ecbebf1c1e4d6;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/registry.go b/pkg/control/registry.go index f9e1bcc..5e9d63e 100644 --- a/pkg/control/registry.go +++ b/pkg/control/registry.go @@ -511,7 +511,7 @@ func (r *Registry) CheckActionTypes(subReqMsg *e2ap.E2APSubscriptionRequest) (ui return e2ap.E2AP_ActionTypeInvalid, fmt.Errorf("Invalid action type in RICactions-ToBeSetup-List") } -func (r *Registry) RemoveFromSubscription(subs *Subscription, trans *TransactionXapp, waitRouteClean time.Duration, c *Control) error { +func (r *Registry) RemoveFromSubscription(subs *Subscription, trans *TransactionXapp, waitRouteClean time.Duration, c *Control) { xapp.Logger.Debug("RemoveFromSubscription %s", idstring(nil, trans, subs, trans)) r.mutex.Lock() @@ -524,7 +524,7 @@ func (r *Registry) RemoveFromSubscription(subs *Subscription, trans *Transaction subId := subs.ReqId.InstanceId if delStatus == false { - return nil + return } if waitRouteClean > 0 { @@ -575,7 +575,7 @@ func (r *Registry) RemoveFromSubscription(subs *Subscription, trans *Transaction } c.UpdateCounter(cUnmergedSubscriptions) } - return nil + return } func (r *Registry) RouteDelete(subs *Subscription, trans *TransactionXapp, c *Control) { @@ -657,15 +657,17 @@ func (r *Registry) DeleteAllE2Subscriptions(ranName string, c *Control) { // Delete REST subscription from registry and db for restSubId, restSubs := range r.restSubscriptions { - if restSubs.Meid == ranName && restSubs.SubReqOngoing == true || restSubs.SubDelReqOngoing == true { - // Subscription creation or deletion processes need to be processed gracefully till the end. - // Subscription is deleted at end of the process in both cases. - xapp.Logger.Debug("Registry: REST subscription under prosessing ongoing cannot delete it yet. RestSubId=%v, SubReqOngoing=%v, SubDelReqOngoing=%v", restSubId, restSubs.SubReqOngoing, restSubs.SubDelReqOngoing) - continue - } else { - xapp.Logger.Debug("Registry: REST subscription delete. subId=%v", restSubId) - delete(r.restSubscriptions, restSubId) - c.RemoveRESTSubscriptionFromDb(restSubId) + if restSubs.Meid == ranName { + if restSubs.SubReqOngoing == true || restSubs.SubDelReqOngoing == true { + // Subscription creation or deletion processes need to be processed gracefully till the end. + // Subscription is deleted at end of the process in both cases. + xapp.Logger.Debug("Registry: REST subscription under prosessing ongoing cannot delete it yet. RestSubId=%v, SubReqOngoing=%v, SubDelReqOngoing=%v", restSubId, restSubs.SubReqOngoing, restSubs.SubDelReqOngoing) + continue + } else { + xapp.Logger.Debug("Registry: REST subscription delete. subId=%v", restSubId) + delete(r.restSubscriptions, restSubId) + c.RemoveRESTSubscriptionFromDb(restSubId) + } } } }