From: Tuan Nguyen Date: Fri, 29 Sep 2023 09:11:45 +0000 (+0000) Subject: RIC-1017: xapp-frame may not be able to successfully subscribe to messages X-Git-Tag: v0.9.21^0 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=766cec8651a649d67509d1cf069c89d0443efec8;p=ric-plt%2Fxapp-frame.git RIC-1017: xapp-frame may not be able to successfully subscribe to messages Change-Id: I18a186a9017818a3464dd7e1f3f637285da4398c Signed-off-by: Tuan Nguyen --- diff --git a/pkg/xapp/xapp.go b/pkg/xapp/xapp.go index 439c177..72a8d32 100755 --- a/pkg/xapp/xapp.go +++ b/pkg/xapp/xapp.go @@ -65,6 +65,7 @@ var ( shutdownFlag int32 shutdownCnt int32 disableAlarmClient bool + isRegistered bool ) var startTime time.Time @@ -81,6 +82,10 @@ func IsReady() bool { return Rmr != nil && Rmr.IsReady() && SdlStorage != nil && SdlStorage.IsReady() } +func IsRegistered() bool { + return isRegistered +} + func SetReadyCB(cb ReadyCB, params interface{}) { readyCb = cb readyCbParams = params @@ -109,6 +114,8 @@ func XappShutdownCb() { if shutdownCb != nil { shutdownCb() } + + isRegistered = false } func registerXapp() { @@ -121,6 +128,7 @@ func registerXapp() { Logger.Debug("Application='%s' is now up and ready, continue with registration ...", viper.GetString("name")) if err := doRegister(); err == nil { + isRegistered = true Logger.Info("Registration done, proceeding with startup ...") break }