使用 spawn exit 方法监听进程退出

This commit is contained in:
whyour
2023-10-07 22:51:44 +08:00
parent ec5b885476
commit 00818b694a
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ export default class CronService {
fs.appendFileSync(`${absolutePath}`, `${JSON.stringify(err)}`);
});
cp.on('close', async (code) => {
cp.on('exit', async (code) => {
await CrontabModel.update(
{ status: CrontabStatus.idle, pid: undefined },
{ where: { id } },