Commit 3e7984f7 authored by Yann Garcia's avatar Yann Garcia
Browse files

Use declared const in service-mgmt.go; Bug fixed in go-apps/meep-sss/server/subscriptionCommon.go

parent 2d193317
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1374,7 +1374,7 @@ func process_choice(choice []string) string {
		message = fmt.Sprintf("Scenario %s activated (wait some seconds before the next command), waiting for MEC pltf started and stable", scenarios[scenarioId].Id)
		fmt.Println("message: " + message)
		// Wait for MEC pltf started and stable
		time.Sleep(time.Duration(20) * time.Second)
		time.Sleep(time.Duration(25) * time.Second)

		appsInfo = client.ApplicationInfo{
			Id:       uuid.New().String(),
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ const globalMepName = "global"
const SER_AVAILABILITY_NOTIF_SUB_TYPE = "SerAvailabilityNotificationSubscription"
const SER_AVAILABILITY_NOTIF_TYPE = "SerAvailabilityNotification"
const APP_STATE_READY = "READY"
const capifEventsBasePath = "/capif-events/v1/"
const capifEventsBasePath = "capif-events/v1"

// const logModuleAppEnablement = "meep-app-enablement"
const serviceName = "App Enablement Service"
@@ -1216,7 +1216,7 @@ func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) {
	}

	// Set Location Header
	updatedBasePath := strings.Replace(basePath, "mec_service_mgmt/v1", "capif-events/v1", 1)
	updatedBasePath := strings.Replace(basePath, "mec_service_mgmt/v1", capifEventsBasePath, 1)
	HrefUrl := hostUrl.String() + updatedBasePath + appId + "/subscriptions/" + subId

	// Send response
+2 −2
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ type SubscriptionCommon struct {
	Links *SubscriptionLinks `json:"_links,omitempty"`
	// URI selected by the service consumer, to receive notifications on the subscribed RNIS information. This shall be included in the request and response.
	SubscriptionType        string              `json:"subscriptionType"`
	RequestTestNotification bool                `json:"requestTestNotification"`
	CallbackReference       string              `json:"callbackReference"`
	RequestTestNotification bool                `json:"requestTestNotification,omitempty"`
	CallbackReference       string              `json:"callbackReference,omitempty"`
	WebsockNotifConfig      *WebsockNotifConfig `json:"websockNotifConfig,omitempty"`
	ExpiryDeadline          *TimeStamp          `json:"expiryDeadline,omitempty"`
}
+9 −1
Original line number Diff line number Diff line
@@ -206,11 +206,12 @@ func (tm *SssMgr) startRefreshTicker() {
			err := tm.populateDevicesPerIotPlatforms()
			if err != nil {
				log.Error(err)
				// continue
			}
			log.Debug("sssmgr.startRefreshTicker: Before Done()")
			tm.wg.Done()
			log.Debug("sssmgr.startRefreshTicker: After Done()")

			continue // Infinite loop till stopRefreshTicker is call
		} // End of 'for' statement
		log.Debug("sssmgr.startRefreshTicker: Leaving time loop")
	}()
@@ -267,6 +268,7 @@ func (tm *SssMgr) GetSensor(sensorIdentifier string) (sensor SensorDiscoveryInfo

	log.Info(">>> GetSensor: sensorIdentifier: ", sensorIdentifier)

	log.Info("GetSensor: Before Synchro")
	tm.wg.Wait()
	log.Info("GetSensor: After Synchro")

@@ -459,6 +461,7 @@ func (tm *SssMgr) OneM2M_create(sensor SensorDiscoveryInfo, path string) (sensor
		return sensorResp, err
	}

	log.Info("OneM2M_create: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_create: After Synchro")

@@ -627,6 +630,7 @@ func (tm *SssMgr) OneM2M_discovery(type_ string, iotPlatformId string) (sensorRe
		return nil, err
	}

	log.Info("OneM2M_discovery: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_discovery: After Synchro")

@@ -718,6 +722,7 @@ func (tm *SssMgr) OneM2M_get(path string, iotPlatformId string) (sensorResp Sens
		return sensorResp, err
	}

	log.Info("OneM2M_get: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_get: After Synchro")

@@ -780,6 +785,7 @@ func (tm *SssMgr) OneM2M_subscribe(iotPlatformId string, path string) (subscript
		return "", err
	}

	log.Info("OneM2M_subscribe: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_subscribe: After Synchro")

@@ -875,6 +881,7 @@ func (tm *SssMgr) OneM2M_delete(sensor SensorDiscoveryInfo) (err error) {
		return err
	}

	log.Info("OneM2M_delete: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_delete: After Synchro")

@@ -925,6 +932,7 @@ func (tm *SssMgr) OneM2M_delete_subscription(subId string) (err error) {
		return err
	}

	log.Info("OneM2M_delete_subscription: Before Synchro")
	tm.wg.Wait()
	log.Info("OneM2M_delete_subscription: After Synchro")