fix(desktop): can't exit

This commit is contained in:
xxnuo
2026-01-01 17:19:09 +08:00
parent 6ba2323ace
commit c09ec6b5ac
2 changed files with 5 additions and 2 deletions

View File

@@ -162,8 +162,11 @@ async function restartServer() {
async function quitApp() {
await logDesktop('quit app');
app.isQuitting = true;
await stopServerInstance();
const stopPromise = stopServerInstance();
const timeoutPromise = new Promise((resolve) => setTimeout(resolve, 5000));
await Promise.race([stopPromise, timeoutPromise]);
app.quit();
setTimeout(() => app.exit(0), 2000);
}
function updateLocale(nextLocale) {

View File

@@ -32,7 +32,7 @@ const messages = {
trayOpenDocs: 'API 文档',
trayOpenRepo: '仓库地址',
trayServiceStatus: '服务状态',
trayServiceRunning: '运行中',
trayServiceRunning: '启动中',
trayServiceStopped: '已停止',
trayServiceManagement: '服务管理',
trayOpenSettings: '设置',