()
| 69 | * 异步清理资源(用于更新安装前,确保 Worker 完全关闭) |
| 70 | */ |
| 71 | export const cleanupAsync = async () => { |
| 72 | console.log('[IpcMain] Cleaning up resources (async)...') |
| 73 | try { |
| 74 | // 关闭 ChatLab API 服务 |
| 75 | await cleanupApiServer() |
| 76 | await cleanupArchiveImportSources() |
| 77 | // 等待 Worker 完全关闭 |
| 78 | await worker.closeWorkerAsync() |
| 79 | console.log('[IpcMain] Cleanup completed') |
| 80 | } catch (error) { |
| 81 | console.error('[IpcMain] Error during async cleanup:', error) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | export default mainIpcMain |
nothing calls this directly
no test coverage detected