MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / getWorkerPath

Function getWorkerPath

apps/desktop/main/worker/workerManager.ts:103–114  ·  view source on GitHub ↗

* 获取 Worker 文件路径 * 开发环境和生产环境路径不同

()

Source from the content-addressed store, hash-verified

101 * 开发环境和生产环境路径不同
102 */
103function getWorkerPath(): string {
104 // 检查是否在开发环境
105 const isDev = !app.isPackaged
106
107 if (isDev) {
108 // 开发环境:编译后的 JS 文件在 out/main 目录
109 return path.join(__dirname, 'worker', 'dbWorker.js')
110 } else {
111 // 生产环境:打包后的路径
112 return path.join(__dirname, 'worker', 'dbWorker.js')
113 }
114}
115
116/**
117 * 初始化 Worker

Callers 1

initWorkerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected