Fixed bug: Delay was not not getting trigerred during config query Re-try
Signed-off-by: wahidw <abdulwahid.w@nokia.com>
Change-Id: I27a3a10739c2790b5a92512297571d735b8724fc
diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go
index c911895..e6bebb7 100755
--- a/pkg/restful/restful.go
+++ b/pkg/restful/restful.go
@@ -210,6 +210,7 @@
appmgr.Logger.Info("Invoked httprestful.httpGetXApps: " + url)
resp, err := http.Get(url)
if err != nil {
+ appmgr.Logger.Error("Error while querying config to Xapp: ", err.Error())
return nil
}
defer resp.Body.Close()
@@ -320,7 +321,6 @@
if xappconfig != nil {
data := parseConfig(xappconfig)
if data != nil {
- appmgr.Logger.Info("iRetry Count = %v", i)
var xapp models.Xapp
xapp.Name = params.AppName
@@ -336,8 +336,9 @@
if configPresent == true {
break
}
- time.Sleep(2 * time.Second)
}
+ appmgr.Logger.Info("Retrying query configuration from xapp, try no : %d", i)
+ time.Sleep(4 * time.Second)
}
return nil, errors.New("Unable to get configmap after 5 retries")
}
@@ -432,9 +433,9 @@
http.HandleFunc("/ric/v1/symptomdata", func(w http.ResponseWriter, req *http.Request) {
d, _ := r.GetApps()
xappData := struct {
- XappList models.AllDeployedXapps `json:"xappList"`
- ConfigList models.AllXappConfig `json:"configList"`
- SubscriptionList models.AllSubscriptions `json:"subscriptionList"`
+ XappList models.AllDeployedXapps `json:"xappList"`
+ ConfigList models.AllXappConfig `json:"configList"`
+ SubscriptionList models.AllSubscriptions `json:"subscriptionList"`
}{
d,
r.getAppConfig(),