Fixed integration and subscription routes related issues for R3
[ric-plt/rtmgr.git] / cmd / rtmgr.go
index 24b917c..568b7ad 100644 (file)
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
+
+
+   This source code is part of the near-RT RIC (RAN Intelligent Controller)
+   platform project (RICP).
+
+
 ==================================================================================
 */
 /*
@@ -41,7 +47,7 @@ import (
 )
 
 const SERVICENAME = "rtmgr"
-const INTERVAL time.Duration = 2
+const INTERVAL time.Duration = 60
 
 var (
        args map[string]*string
@@ -117,7 +123,6 @@ func serve(nbiEngine nbi.Engine, sbiEngine sbi.Engine, sdlEngine sdl.Engine, rpe
        go serveSBI(triggerSBI, sbiEngine, sdlEngine, rpeEngine)
 
        for {
-               time.Sleep(INTERVAL * time.Second)
                if *args["nbi"] == "httpGetter" {
                        data, err := nbiEngine.(*nbi.HttpGetter).FetchAllXApps(*args["xm-url"])
                        if err != nil {
@@ -128,6 +133,9 @@ func serve(nbiEngine nbi.Engine, sbiEngine sbi.Engine, sdlEngine sdl.Engine, rpe
                }
 
                triggerSBI <- true
+
+               time.Sleep(INTERVAL * time.Second)
+               rtmgr.Logger.Debug("Periodic loop timed out. Setting triggerSBI flag to distribute updated routes.")
        }
 }