X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fresthooks%2Fresthooks.go;h=9ac49f921b79bc8f9fc4c98cfeb46a040d423247;hb=d3aa5b98789c65107e5ac41fc5be11f08acf11d8;hp=dea70c91c5a9e287212dd337dba2ce3163a9c2b2;hpb=2a4099785bcc1dda74d5192f93f69b33533585b3;p=ric-plt%2Fappmgr.git diff --git a/pkg/resthooks/resthooks.go b/pkg/resthooks/resthooks.go index dea70c9..9ac49f9 100755 --- a/pkg/resthooks/resthooks.go +++ b/pkg/resthooks/resthooks.go @@ -33,9 +33,13 @@ import ( ) func NewResthook(restoreData bool) *Resthook { + return createResthook(restoreData, sdl.NewSdlInstance("appmgr", sdl.NewDatabase())) +} + +func createResthook(restoreData bool, sdlInst iSdl) *Resthook { rh := &Resthook{ client: &http.Client{}, - db: sdl.NewSdlInstance("appmgr", sdl.NewDatabase()), + db: sdlInst, } if restoreData { @@ -176,7 +180,6 @@ func (rh *Resthook) retry(s SubscriptionInfo, fn func() error) error { func (rh *Resthook) StoreSubscriptions(m cmap.ConcurrentMap) { for v := range m.Iter() { s := v.Val.(SubscriptionInfo) - data, err := json.Marshal(s.req) if err != nil { appmgr.Logger.Error("json.marshal failed: %v ", err.Error())