mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-10 19:50:28 +08:00
fix: add delay before core restart to avoid pipe connection race condition
This commit is contained in:
parent
5eee22292e
commit
fdb57431ba
1
mihomo-party-helper
Submodule
1
mihomo-party-helper
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit de9142c446d820ad047fef1cb52e7d07e0c04e8c
|
||||||
@ -86,6 +86,8 @@ export function initCoreWatcher(): void {
|
|||||||
coreWatcher = chokidar.watch(path.join(mihomoCoreDir(), 'meta-update'), {})
|
coreWatcher = chokidar.watch(path.join(mihomoCoreDir(), 'meta-update'), {})
|
||||||
coreWatcher.on('unlinkDir', async () => {
|
coreWatcher.on('unlinkDir', async () => {
|
||||||
try {
|
try {
|
||||||
|
// 等待核心自我更新完成,避免管道连接竞态
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 2000))
|
||||||
await stopCore(true)
|
await stopCore(true)
|
||||||
await startCore()
|
await startCore()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user