[WRTjs][Service] Call finalizeService after service app's worker deleted 55/309855/5 submit/tizen/20240513.160027
authorChunling Ye <chunling.ye@samsung.com>
Wed, 17 Apr 2024 10:07:48 +0000 (18:07 +0800)
committerye chuanling <chunling.ye@samsung.com>
Fri, 26 Apr 2024 03:44:04 +0000 (03:44 +0000)
Have relationship with patch:
https://review.tizen.org/gerrit/309848

Change-Id: Ic1afb2cabc4ac60c76212b7c90c1d7084fef143b
Signed-off-by: Chunling Ye <chunling.ye@samsung.com>
wrt_app/service/service_manager.ts
wrt_app/service/service_runner.ts

index 37fea323b83a30bc0f2cd03f5c267eb13bc77463..4d8b55ba0b9fc4eb09c761ade6af06d083c03b61 100644 (file)
@@ -96,6 +96,9 @@ function createWorker(id: string, startService: string, filename: string) {
     wrt.tv?.serviceUmount(id);
     delete workerStatus[id];
     delete workers[id];
+    console.debug(`${id} workers deleted`);
+    if (global['serviceType'] === 'GLOBAL')
+      wrt.finalizeService(id);
     let runningServices = Object.keys(workers);
     console.debug(`${id} terminated, remain services(${runningServices})`);
     checkDyingWorker();
@@ -105,6 +108,8 @@ function createWorker(id: string, startService: string, filename: string) {
 function terminateWorker(id: string, delay: number) {
   if (!workers[id]) {
     console.debug(`This worker is already terminated. ${id}`);
+    if (global['serviceType'] === 'GLOBAL')
+      wrt.finalizeService(id);
     return;
   }
   console.debug(`${id} will shutdown after ${delay}ms`);
index 35db1a60652a906b151f0afb0621d4e1146d9681..22803f5a4a39c8b98b3e03d30db84a3d085ab61e 100644 (file)
@@ -137,9 +137,6 @@ export function stop(id: string) {
     }
   } catch (e) {
     console.debug(`exception on stop: ${e}`);
-  } finally {
-    if (isGlobalService())
-      wrt.finalizeService(id);
   }
 }