增加自动运行任务时任务状态展示

1.  添加bot远程地址
2. 增加文件后缀配置
3. 增加定时任务页数缓存
This commit is contained in:
hanhh
2021-06-13 18:18:01 +08:00
parent 424a1e6491
commit 1923ceb5c2
9 changed files with 96 additions and 10 deletions
+21
View File
@@ -225,4 +225,25 @@ export default (app: Router) => {
}
},
);
route.put(
'/crons/status',
celebrate({
body: Joi.object({
ids: Joi.array().items(Joi.string().required()),
status: Joi.string().required(),
}),
}),
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);
return res.send({ code: 200, data });
} catch (e) {
logger.error('🔥 error: %o', e);
return next(e);
}
},
);
};