执行任务增加结束日志

This commit is contained in:
whyour
2024-08-31 14:43:44 +08:00
parent a48d100b2d
commit 7414a9d33d
3 changed files with 39 additions and 4 deletions
+8
View File
@@ -31,6 +31,14 @@ export function runCron(cmd: string, cron: ICron): Promise<number | void> {
cp.on('exit', async (code) => {
taskLimit.removeQueuedCron(cron.id);
Logger.info(
'[schedule][执行任务结束] 参数: %s, 退出码: %j',
JSON.stringify({
...cron,
command: cmd,
}),
code,
);
resolve({ ...cron, command: cmd, pid: cp.pid, code });
});
});