fix: add delay before core restart to avoid pipe connection race condition

This commit is contained in:
xmk23333 2026-01-15 18:30:27 +08:00
parent 5eee22292e
commit fdb57431ba
2 changed files with 3 additions and 0 deletions

1
mihomo-party-helper Submodule

@ -0,0 +1 @@
Subproject commit de9142c446d820ad047fef1cb52e7d07e0c04e8c

View File

@ -86,6 +86,8 @@ export function initCoreWatcher(): void {
coreWatcher = chokidar.watch(path.join(mihomoCoreDir(), 'meta-update'), {})
coreWatcher.on('unlinkDir', async () => {
try {
// 等待核心自我更新完成,避免管道连接竞态
await new Promise((resolve) => setTimeout(resolve, 2000))
await stopCore(true)
await startCore()
} catch (e) {