修复任务详情日志列表卡顿

This commit is contained in:
whyour
2023-07-27 23:15:48 +08:00
parent 6832cb4e22
commit 39bfd39559
16 changed files with 71 additions and 32 deletions
+7 -3
View File
@@ -17,7 +17,7 @@ const addCron = (
scheduleStacks.get(id)?.cancel();
}
let cmdStr = command;
let cmdStr = command.trim();
if (!cmdStr.startsWith(TASK_PREFIX) && !cmdStr.startsWith(QL_PREFIX)) {
cmdStr = `${TASK_PREFIX}${cmdStr}`;
}
@@ -25,8 +25,12 @@ const addCron = (
scheduleStacks.set(
id,
nodeSchedule.scheduleJob(id, schedule, async () => {
Logger.silly(`当前时间: ${dayjs().format('YYYY-MM-DD HH:mm:ss')},运行命令: ${cmdStr}`);
runCron(`ID=${id} ${cmdStr}`)
Logger.info(
`当前时间: ${dayjs().format(
'YYYY-MM-DD HH:mm:ss',
)},运行命令: ${cmdStr}`,
);
runCron(`ID=${id} ${cmdStr}`);
}),
);
}