From: liwei Date: Wed, 27 Oct 2021 13:58:24 +0000 (+0800) Subject: [Service][VD] Change timing of service mount / umount X-Git-Tag: submit/tizen/20211029.160020^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F265715%2F2;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service][VD] Change timing of service mount / umount Make early mount and delay timing of service app umount, while service app terminate, extension is cleaning up, so delay timing of service app umount. Change-Id: I9ba861cf52d66c3efc6ea4088348e402c20d6604 Signed-off-by: liwei --- diff --git a/wrt_app/service/service_manager.ts b/wrt_app/service/service_manager.ts index b11e12a..fe3fd77 100644 --- a/wrt_app/service/service_manager.ts +++ b/wrt_app/service/service_manager.ts @@ -18,6 +18,7 @@ function createWorker(id: string, startService: string, filename: string) { return; } + wrt.tv?.serviceMount(id); workers[id] = new Worker(startService, { workerData: { id, @@ -30,6 +31,7 @@ function createWorker(id: string, startService: string, filename: string) { } }); workers[id].on('exit', (code: number) => { + wrt.tv?.serviceUmount(id); delete workers[id]; let runningServices = Object.keys(workers); console.debug(`exit code(${code}), remain services(${runningServices})`); diff --git a/wrt_app/service/service_runner.ts b/wrt_app/service/service_runner.ts index d110017..c7e40d2 100644 --- a/wrt_app/service/service_runner.ts +++ b/wrt_app/service/service_runner.ts @@ -151,7 +151,6 @@ function run() { writable: false }); - wrt.tv?.serviceMount(id); let filename = workerData.filename; start(id, filename); @@ -165,7 +164,6 @@ function run() { XWalkExtension.cleanup(); parentPort?.postMessage("will-terminate"); parentPort?.close(); - wrt.tv?.serviceUmount(id); }, message.delay); } });