X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Fxapp.go;fp=pkg%2Fxapp%2Fxapp.go;h=72a8d321168c0463ea59c54e0542f35c17006c4c;hb=766cec8651a649d67509d1cf069c89d0443efec8;hp=439c1778ab0834bf89037441ce75be2fa4266369;hpb=43c2cf01ce523b9c9c05e6defc450b9454cd2a7c;p=ric-plt%2Fxapp-frame.git 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 }