From 21bd7d335410ef2c5d4192d0df7d0a2e5227af8f Mon Sep 17 00:00:00 2001 From: "jaehoon.hyun" Date: Tue, 23 Apr 2019 19:10:41 +0900 Subject: [PATCH] src/interface/main.go enhancement main scoringmgr thread working Ready variable add Change-Id: Ia46935e82c2b5be22ccf3f0fa1a0a7a34b76b482 --- src/interface/main.go | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/interface/main.go b/src/interface/main.go index b659268..848ce62 100755 --- a/src/interface/main.go +++ b/src/interface/main.go @@ -72,11 +72,10 @@ func OrchestrationInit() (errCode C.int) { orcheEngine.IScoringmgr = scoringmgr.Init() orcheEngine.IConfiguremgr = configuremgr.Init() - discoverymgr.InitDiscovery() - servicemgr.Init() - securemgr.Init(keyFilePath) orcheEngine.IScoringmgr.IRunningScore = scoringmgr.LoadScoringGeneralInterface + orcheEngine.IScoringmgr.IStartResourceService = scoringmgr.StartResourceService + orcheEngine.IScoringmgr.IStopResourceService = scoringmgr.StopResourceService orcheEngine.IScoringmgr.IGetScore = scoringmgr.GetScore orcheEngine.IScoringmgr.Ch = make(chan interface{}, 1024) @@ -87,15 +86,35 @@ func OrchestrationInit() (errCode C.int) { orcheEngine.IDiscoverymgr.GetEndpointDevices = discoverymgr.GetDeviceListWithService orcheEngine.IServicemgr.ExecuteApp = servicemgr.ExecuteApp + //1.scoringmgr init orcheEngine.IScoringmgr.Listening() + orcheEngine.IScoringmgr.IStartResourceService() + + //2.configuremgr init go orcheEngine.IConfiguremgr.Watch("/etc/edge-orchestration") + //3.securemgr init + securemgr.Init(keyFilePath) + + //4.servicemgr init + servicemgr.Init() + + //5.discoverymgr init + discoverymgr.InitDiscovery() + discoverymgr.GetDeviceList() + + //6.httpserver init router := restapi.NewRouter() go http.ListenAndServe(fmt.Sprintf(":%d", ConstWellknownPort), router) - discoverymgr.GetDeviceList() - + errCode = 0 + + log.Println(logPrefix, "orchestration init done") + + //NOTE : CMain work init thread and requestservice thread seperatly. + //NOTE : Need Ready variable. + orcheEngine.Ready = true return } -- 2.7.4