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

Function cleanupAsync

apps/desktop/main/ipcMain.ts:71–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 * 异步清理资源(用于更新安装前,确保 Worker 完全关闭)
70 */
71export 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
85export default mainIpcMain

Callers

nothing calls this directly

Calls 3

cleanupApiServerFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected