fix: 为 callPython 添加 spawn 错误处理,防止进程启动失败时永久挂起
This commit is contained in:
parent
aee1c6bb69
commit
1c164ea3d9
@ -28,6 +28,7 @@ function callPython(payload) {
|
||||
reject(new Error("Python 返回了无效 JSON: " + stdout));
|
||||
}
|
||||
});
|
||||
proc.on("error", (e) => reject(new Error("Python 进程启动失败: " + e.message)));
|
||||
proc.stdin.write(JSON.stringify(payload) + "\n");
|
||||
proc.stdin.end();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user