X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fxapp%2Fxapp.go;h=e832436500517b2ddb3500af406f75eba6c1a293;hb=bb554448a2eb866606db0fea7a1d689005569ff4;hp=0e85845be990680f503ea58a6423cf16d74af59f;hpb=fea604a8972776006ac5231425ea5799a93cf06c;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/xapp.go b/pkg/xapp/xapp.go index 0e85845..e832436 100755 --- a/pkg/xapp/xapp.go +++ b/pkg/xapp/xapp.go @@ -37,6 +37,7 @@ import ( ) // For testing purpose go version 1.13 -> + var _ = func() bool { testing.Init() return true @@ -49,6 +50,7 @@ var ( // XApp is an application instance Rmr *RMRClient Sdl *SDLClient + SdlStorage *SDLStorage Rnib *RNIBClient Resource *Router Metric *Metrics @@ -65,7 +67,7 @@ var ( ) func IsReady() bool { - return Rmr != nil && Rmr.IsReady() && Sdl != nil && Sdl.IsReady() + return Rmr != nil && Rmr.IsReady() && SdlStorage != nil && SdlStorage.IsReady() } func SetReadyCB(cb ReadyCB, params interface{}) { @@ -263,8 +265,9 @@ func init() { Config = Configurator{} Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router) Subscription = NewSubscriber(viper.GetString("controls.subscription.host"), viper.GetInt("controls.subscription.timeout")) + SdlStorage = NewSdlStorage() Sdl = NewSDLClient(viper.GetString("controls.db.namespace")) - Rnib = NewRNIBClient() + Rnib = GetNewRnibClient(SdlStorage.db) Util = NewUtils() InstallSignalHandler() @@ -308,7 +311,7 @@ func RunWithParams(c MessageConsumer, sdlcheck bool) { Logger.Info(fmt.Sprintf("Xapp started, listening on: %s", host)) if sdlcheck { - Sdl.TestConnection() + SdlStorage.TestConnection(viper.GetString("controls.db.namespace")) } go registerXapp()