修复定时任务间隔较小,任务状态不准确

This commit is contained in:
whyour
2023-09-26 22:51:33 +08:00
parent 77a8e00b17
commit eddc03e295
8 changed files with 25 additions and 14 deletions
+2 -3
View File
@@ -458,13 +458,12 @@ export default (app: Router) => {
}),
}),
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const cronService = Container.get(CronService);
const data = await cronService.status({
...req.body,
status: parseInt(req.body.status),
pid: parseInt(req.body.pid) || '',
status: req.body.status ? parseInt(req.body.status) : undefined,
pid: req.body.pid ? parseInt(req.body.pid) : undefined,
});
return res.send({ code: 200, data });
} catch (e) {