【发布时间】:2020-04-05 01:34:36
【问题描述】:
我正在尝试在 Node.js 中终止以前派生的子进程。我不确定它是否有效,因为我的 console.log 行没有在子进程中被击中。
这是我从家长那里打来的电话:
console.log("sending SIGINT from main");
child.kill("SIGINT");
在孩子身上:
process.on("SIGINT", () => {
console.log("Killing bot");
DBS.Bot.destroy();
process.exit();
});
我看到的唯一控制台日志来自父级。
【问题讨论】: