Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
RICPLT-3007 Replace msg Mtype numbers with variables defined in xapp frame
[ric-plt/submgr.git]
/
pkg
/
control
/
registry.go
diff --git
a/pkg/control/registry.go
b/pkg/control/registry.go
index
0970a3a
..
a1fe4b8
100644
(file)
--- a/
pkg/control/registry.go
+++ b/
pkg/control/registry.go
@@
-58,6
+58,7
@@
func (r *Registry) ReserveSubscription(endPoint *RmrEndpoint, meid *xapp.RMRMeid
}
if _, ok := r.register[sequenceNumber]; ok == false {
subs := &Subscription{
}
if _, ok := r.register[sequenceNumber]; ok == false {
subs := &Subscription{
+ registry: r,
Seq: sequenceNumber,
Active: false,
RmrEndpoint: *endPoint,
Seq: sequenceNumber,
Active: false,
RmrEndpoint: *endPoint,
@@
-68,7
+69,7
@@
func (r *Registry) ReserveSubscription(endPoint *RmrEndpoint, meid *xapp.RMRMeid
// Update routing
r.mutex.Unlock()
// Update routing
r.mutex.Unlock()
- err := subs.UpdateRoute(CREATE
, r.rtmgrClient
)
+ err := subs.UpdateRoute(CREATE)
r.mutex.Lock()
if err != nil {
if _, ok := r.register[sequenceNumber]; ok {
r.mutex.Lock()
if err != nil {
if _, ok := r.register[sequenceNumber]; ok {
@@
-96,16
+97,7
@@
func (r *Registry) DelSubscription(sn uint16) bool {
r.mutex.Lock()
defer r.mutex.Unlock()
if _, ok := r.register[sn]; ok {
r.mutex.Lock()
defer r.mutex.Unlock()
if _, ok := r.register[sn]; ok {
- subs := r.register[sn]
delete(r.register, sn)
delete(r.register, sn)
-
- // Update routing
- r.mutex.Unlock()
- err := subs.UpdateRoute(DELETE, r.rtmgrClient)
- r.mutex.Lock()
- if err != nil {
- xapp.Logger.Error("Registry: Failed to del route. SubId: %d, RmrEndpoint: %s", subs.Seq, subs.RmrEndpoint)
- }
return true
}
return false
return true
}
return false