From: DongHyun Song Date: Tue, 29 Dec 2020 08:45:21 +0000 (+0900) Subject: [Service] Apply worker to 'standalone' model X-Git-Tag: submit/tizen/20210106.045044^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=121c9f9320b787159d5aff9ba84d169ffd224155;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service] Apply worker to 'standalone' model '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 --- diff --git a/wrt_app/common/service_manager.ts b/wrt_app/common/service_manager.ts index 14f0a874..face443b 100644 --- a/wrt_app/common/service_manager.ts +++ b/wrt_app/common/service_manager.ts @@ -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) {