X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fcontrol%2Fregistry.go;h=2495d3b9ba249786977dd385d482441975de26a0;hb=3d72245cf4fe066824d50a5c43a0ecd49438d3ad;hp=bd4e15aeebfdf171be79c631054c0b39db60c525;hpb=55d2a285e4914afce7492c6b4b6feebe5485210b;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/registry.go b/pkg/control/registry.go index bd4e15a..2495d3b 100644 --- a/pkg/control/registry.go +++ b/pkg/control/registry.go @@ -40,12 +40,29 @@ type RESTSubscription struct { xAppIdToE2Id map[int64]int64 SubReqOngoing bool SubDelReqOngoing bool + lastReqMd5sum string } func (r *RESTSubscription) AddE2InstanceId(instanceId uint32) { + + for _, v := range r.InstanceIds { + if v == instanceId { + return + } + + } + r.InstanceIds = append(r.InstanceIds, instanceId) } +func (r *RESTSubscription) AddMd5Sum(md5sum string) { + if md5sum != "" { + r.lastReqMd5sum = md5sum + } else { + xapp.Logger.Error("EMPTY md5sum attempted to be add to subscrition") + } +} + func (r *RESTSubscription) DeleteE2InstanceId(instanceId uint32) { r.InstanceIds = r.InstanceIds[1:] } @@ -62,8 +79,11 @@ func (r *RESTSubscription) DeleteXappIdToE2Id(xAppEventInstanceID int64) { delete(r.xAppIdToE2Id, xAppEventInstanceID) } -func (r *RESTSubscription) SetProcessed() { +func (r *RESTSubscription) SetProcessed(err error) { r.SubReqOngoing = false + if err != nil { + r.lastReqMd5sum = "" + } } type Registry struct {