X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fcontrol%2Fcontrol.go;h=08000b0505e1c802b5d1b84e15a6aebf8fb7d63d;hb=e1af87f0759201f64804eff5911c4e6c0e859be9;hp=87c81ff2019effb8b27b9b59987ed663e6bf975a;hpb=c7da4ee19c2b2a96c1eeccd8da944902fcd9323f;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/control.go b/pkg/control/control.go index 87c81ff..08000b0 100755 --- a/pkg/control/control.go +++ b/pkg/control/control.go @@ -150,7 +150,7 @@ func NewControl() *Control { e2SubsDb: CreateSdl(), restSubsDb: CreateRESTSdl(), Counters: xapp.Metric.RegisterCounterGroup(GetMetricsOpts(), "SUBMGR"), - LoggerLevel: 4, + LoggerLevel: 1, } e2IfState.Init(c) @@ -161,16 +161,13 @@ func NewControl() *Control { xapp.Resource.InjectRoute("/ric/v1/restsubscriptions", c.GetAllRestSubscriptions, "GET") xapp.Resource.InjectRoute("/ric/v1/symptomdata", c.SymptomDataHandler, "GET") - if readSubsFromDb == "false" { - return c + if readSubsFromDb == "true" { + // Read subscriptions from db + c.ReadE2Subscriptions() + c.ReadRESTSubscriptions() } - // Read subscriptions from db - c.ReadE2Subscriptions() - c.ReadRESTSubscriptions() - go xapp.Subscription.Listen(c.RESTSubscriptionHandler, c.RESTQueryHandler, c.RESTSubscriptionDeleteHandler) - return c } @@ -242,6 +239,7 @@ func (c *Control) ReadConfigParameters(f string) { c.LoggerLevel = int(xapp.Logger.GetLevel()) xapp.Logger.Debug("LoggerLevel= %v", c.LoggerLevel) + c.e2ap.SetASN1DebugPrintStatus(c.LoggerLevel) // viper.GetDuration returns nanoseconds e2tSubReqTimeout = viper.GetDuration("controls.e2tSubReqTimeout_ms") * 1000000 @@ -1112,7 +1110,6 @@ func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *Tran removeSubscriptionFromDb = true subRfMsg, valid = subs.SetCachedResponse(event, false) xapp.Logger.Debug("SUBS-SubReq: internal delete due failure event(%s) %s", typeofSubsMessage(event), idstring(nil, trans, subs, parentTrans)) - c.sendE2TSubscriptionDeleteRequest(subs, trans, parentTrans) case *SubmgrRestartTestEvent: // This simulates that no response has been received and after restart subscriptions are restored from db xapp.Logger.Debug("Test restart flag is active. Dropping this transaction to test restart case")