From 766cec8651a649d67509d1cf069c89d0443efec8 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Fri, 29 Sep 2023 09:11:45 +0000 Subject: [PATCH] RIC-1017: xapp-frame may not be able to successfully subscribe to messages Change-Id: I18a186a9017818a3464dd7e1f3f637285da4398c Signed-off-by: Tuan Nguyen --- pkg/xapp/xapp.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 } -- 2.16.6