[Service] Apply worker to 'standalone' model 46/250546/3 submit/tizen/20210106.045044
authorDongHyun Song <dh81.song@samsung.com>
Tue, 29 Dec 2020 08:45:21 +0000 (17:45 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 30 Dec 2020 12:20:09 +0000 (12:20 +0000)
'standalone' model will not be used anywhere.
TV will apply global wrt-service on Tizen 6.5

Change-Id: I1ebe5fbea6a9db4f56c1d9fb0c58cfa7e76fdb63
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/service_manager.ts

index 14f0a87..face443 100644 (file)
@@ -12,10 +12,6 @@ Object.defineProperty(global, 'serviceType', {
   writable: false
 });
 
-function isStandalone() {
-  return global['serviceType'] === 'STANDALONE';
-}
-
 function createWorker(id: string, startService: string, filename: string) {
   if (workers[id])
     return;
@@ -49,26 +45,13 @@ function terminateWorker(id: string, delay: number) {
 
 export function startService(id: string, filename: string) {
   console.log(`startService - ${id}`);
-  if (isStandalone()) {
-    runner = require('../common/service_runner');
-    runner.start(id, filename);
-  } else {
-    let startService = `${__dirname}/service_runner.js`;
-    createWorker(id, startService, filename);
-  }
+  let startService = `${__dirname}/service_runner.js`;
+  createWorker(id, startService, filename);
 }
 
 export function stopService(id: string) {
   console.log(`stopService - ${id}`);
-  if (isStandalone()) {
-    if (!runner) {
-      console.log('runner instance is null in standalone mode');
-      return;
-    }
-    runner.stop(id);
-  } else {
-    terminateWorker(id, 500);
-  }
+  terminateWorker(id, 500);
 }
 
 export function handleBuiltinService(serviceId: string, serviceName: string) {