[Service] Add service type in node worker 10/245010/1
authorliwei <wei90727.li@samsung.com>
Tue, 29 Sep 2020 05:44:54 +0000 (13:44 +0800)
committerliwei <wei90727.li@samsung.com>
Tue, 29 Sep 2020 05:47:35 +0000 (13:47 +0800)
Add service type in node worker, otherwise value of
"global.serviceType" is 'undefined', service app in
global service cannot work well.

Change-Id: I39fadd30c14b89f20b1bf817fe4d9db46f65eb44
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/common/service_runner.ts

index 286297a..43681b5 100644 (file)
@@ -4,6 +4,8 @@ import { DeviceAPIRouter } from '../service/device_api_router';
 import { isMainThread, parentPort, workerData } from 'worker_threads';
 import { wrt } from '../browser/wrt';
 
+global.serviceType = wrt.getServiceModel();
+
 function isServiceApplication() {
   return global.serviceType !== 'UI';
 }