fix: 加固退出清理

退出应用时终止后台 进程
移除运行时动态安装 Python 依赖
This commit is contained in:
Wxw-Gu
2026-08-21 15:37:01 +08:00
parent 262b15db84
commit b324f480dd
6 changed files with 60 additions and 62 deletions
+4 -2
View File
@@ -1857,13 +1857,15 @@ app.on('before-quit', (event) => {
void (async () => {
agentHubService.stop()
personalWechatSendService.stop()
flushBootstrapCacheWritesSync()
const [, nativeCallsDrained] = await Promise.all([
apiServer.stop().catch(() => undefined),
chat.closeChatDbForQuit().catch(() => false),
voiceRecognition?.dispose().catch(() => undefined),
knowledgeSearchService?.dispose().catch(() => undefined)
knowledgeSearchService?.dispose().catch(() => undefined),
personalWechatSendService.terminate().catch((error) => {
console.warn('[Shutdown] personal WeChat sender cleanup failed:', error)
})
])
if (!nativeCallsDrained) {
console.warn('[Shutdown] WCDB async calls did not fully drain before quit')