From 3d187f96060e9c367e861017b61cef832c9aa163 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Fri, 4 Jun 2021 11:32:21 +0900 Subject: [PATCH] [Service][Workaround] Make singleton worker thread before app start This patch will make singleton webapi worker thread ahead of app launching to keep it 'User' smack label. There are lots usage of putting message at singleton worker thread by - TaskQueue::GetInstance().Queue() - TaskQueue::GetInstance().Async() tizen.systeminfo.getPropertyValue() is one of API to use TaskQueue singleton instance. + remove unnecessary log Related patch of filesystem webapi worker issue: https://review.tizen.org/gerrit/#/c/platform/core/api/webapi-plugins/+/259382/ Change-Id: I7e0abe5e93335d2798bc388f22a88aff754d8d2b Signed-off-by: DongHyun Song --- wrt_app/common/service_runner.ts | 13 +++++++++---- wrt_app/service/device_api_router.ts | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wrt_app/common/service_runner.ts b/wrt_app/common/service_runner.ts index 3b5c308..93be76e 100644 --- a/wrt_app/common/service_runner.ts +++ b/wrt_app/common/service_runner.ts @@ -78,16 +78,21 @@ export function start(id: string, filename: string) { console.log(`serviceType : ${global['serviceType']}`) new DeviceAPIRouter(id, isGlobalService()); + // this is workaround solution to make webapis singleton worker + // ahead of dropThreadPrivilege() + global.tizen.systeminfo.getPropertyValue("CPU", () => { }, () => { }); + + // This is for awaking up uv loop. + dummyTimer = setInterval(() => { + checkLauncherAlive(id); + }, 100); + if (isServiceApplication()) { registerExtensionResolver(id); filename = wrt.getStartServiceFile(id); console.log(`start global service file: ${filename}`); } - // This is for awaking up uv loop. - dummyTimer = setInterval(() => { - checkLauncherAlive(id); - }, 100); printAppControlData(id); try { diff --git a/wrt_app/service/device_api_router.ts b/wrt_app/service/device_api_router.ts index 3347e61..ae2fd53 100644 --- a/wrt_app/service/device_api_router.ts +++ b/wrt_app/service/device_api_router.ts @@ -311,7 +311,6 @@ export class DeviceAPIRouter { injectVirtualRootResolver(func: Function) { return (...args: any[]) => { - console.log('arguments : ' + args); if (args.length && !(args[0] === null || args[0] === undefined)) { args[0] = wrt.resolveVirtualRoot(this.getServiceId(), args[0]); console.log('updated argument[0] : ' + args[0]); -- 2.7.4