[Service][VD] Fix mount point remain issue 32/238332/2
authorDongHyun Song <dh81.song@samsung.com>
Mon, 13 Jul 2020 01:30:29 +0000 (10:30 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Mon, 13 Jul 2020 05:13:09 +0000 (14:13 +0900)
While stopService, program.exit() is called synchronously. It will
terminate wrt-service process directly, then mount point is still
remaining without umount handling.

Change-Id: Ife943100cd6a8cd814fd0fb63693195459b8b607
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/service/main.ts

index 26cf56f..3aa42ee 100755 (executable)
@@ -28,8 +28,9 @@ wrt.on('start-service', (event: any, internal_id: string) => {
 
 wrt.on('stop-service', (event: any, internal_id: string) => {
   ServiceManager.stopService(internal_id);
-  if (wrt.getServiceModel() == "STANDALONE")
-    process.exit();
+  if (wrt.getServiceModel() === 'STANDALONE') {
+    setTimeout(() => {process.exit()}, 10);
+  }
 });
 
 wrt.on('builtin-service', (event: any, internal_id: string, service_name: string) => {