X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fvespamgr%2Fvespamgr.go;fp=cmd%2Fvespamgr%2Fvespamgr.go;h=4cc6c8e892b31d794feea7ae1d458cec47f62968;hb=33423f936483c08fe84b6c327c4a148c68863f3b;hp=1a5246f2d6f427d0612313334ecfd655dab1622c;hpb=ef79f021e035116716165e423138fc0e843428e1;p=ric-plt%2Fvespamgr.git diff --git a/cmd/vespamgr/vespamgr.go b/cmd/vespamgr/vespamgr.go index 1a5246f..4cc6c8e 100755 --- a/cmd/vespamgr/vespamgr.go +++ b/cmd/vespamgr/vespamgr.go @@ -144,9 +144,11 @@ func (v *VespaMgr) HandleSupervision(w http.ResponseWriter, r *http.Request) { } func (v *VespaMgr) HandleMeasurements(w http.ResponseWriter, r *http.Request) { - app.Logger.Info("HandleMeasurements called!") if appConfig, err := v.ReadPayload(w, r); err == nil { - v.CreateConf(app.Config.GetString("controls.vesagent.configFile"), appConfig) + filePath := app.Config.GetString("controls.pltFile") + if err := ioutil.WriteFile(filePath, appConfig, 0666); err == nil { + v.pltFileCreated = true + } } } @@ -190,9 +192,8 @@ func (v *VespaMgr) SubscribeXappNotif(appmgrUrl string) { targetUrl := fmt.Sprintf("%s%s", app.Config.GetString("controls.host"), v.appmgrNotifUrl) subscriptionData := []byte(fmt.Sprintf(`{"Data": {"maxRetries": 5, "retryTimer": 5, "eventType":"all", "targetUrl": "%v"}}`, targetUrl)) - for { + for i := 0; i < v.appmgrRetry; i++ { app.Logger.Info("Subscribing xApp notification from: %v", appmgrUrl) - if id := v.DoSubscribe(appmgrUrl, subscriptionData); id != "" { app.Logger.Info("Subscription done, id=%s", id) break