mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 01:05:30 +08:00
fix: 修复 Windows 自动更新提示无法关闭与退出残留
This commit is contained in:
1 parent
b86582e606
commit
c0b921c109
15 files changed
+801
-102
No files matched your search
+12
-1
@@ -1494,7 +1494,18 @@ export function startHttpServer(
|
||||
port: actualPort,
|
||||
close: () =>
|
||||
new Promise<void>((res) => {
|
||||
server.close(() => res())
|
||||
let settled = false
|
||||
const finish = (): void => {
|
||||
if (settled) return
|
||||
settled = true
|
||||
clearTimeout(timer)
|
||||
res()
|
||||
}
|
||||
// HTTP keep-alive 或长连接会阻塞 server.close(),退出时主动断开全部连接。
|
||||
const timer = setTimeout(finish, 1_500)
|
||||
server.close(() => finish())
|
||||
server.closeIdleConnections?.()
|
||||
server.closeAllConnections?.()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user