From 514e203483b8e7092e7eda70fd74a7d11da9c7f7 Mon Sep 17 00:00:00 2001 From: SmallMain Date: Wed, 23 Oct 2024 16:10:15 +0800 Subject: [PATCH] =?UTF-8?q?[adapters]=20=E6=9A=82=E6=97=B6=E7=A6=81?= =?UTF-8?q?=E7=94=A8=20useExperimentalWorker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platforms/wechat/res/worker_adapter/ipc-main.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/adapters/platforms/wechat/res/worker_adapter/ipc-main.js b/adapters/platforms/wechat/res/worker_adapter/ipc-main.js index 31ee9845..2f873b0d 100644 --- a/adapters/platforms/wechat/res/worker_adapter/ipc-main.js +++ b/adapters/platforms/wechat/res/worker_adapter/ipc-main.js @@ -16,14 +16,8 @@ const ipcMain = { init(callback) { this._initCallback = callback; - this.worker = wx.createWorker("workers/index.js", { useExperimentalWorker: true }); - - this.worker.onProcessKilled(() => { - console.warn("worker has been killed"); - this.worker.terminate(); - this.worker = null; - // TODO 这里还未正确处理,还需要重新 init cacheManager 等等,把这边对属性的修改同步过来 - }); + // NOTE { useExperimentalWorker: true } 会让有状态的 Worker 处理很复杂,暂时不使用 + this.worker = wx.createWorker("workers/index.js"); this.worker.onMessage( CC_WORKER_SCHEDULER