修改并发逻辑,系统设置增加定时任务并发设置

This commit is contained in:
whyour
2023-07-01 15:26:20 +08:00
parent db227e56bf
commit 702c3160ec
18 changed files with 163 additions and 88 deletions
+7 -6
View File
@@ -70,12 +70,12 @@ export default (app: Router) => {
});
route.get(
'/log/remove',
'/config',
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const systemService = Container.get(SystemService);
const data = await systemService.getLogRemoveFrequency();
const data = await systemService.getSystemConfig();
res.send({ code: 200, data });
} catch (e) {
return next(e);
@@ -84,18 +84,19 @@ export default (app: Router) => {
);
route.put(
'/log/remove',
'/config',
celebrate({
body: Joi.object({
frequency: Joi.number().required(),
logRemoveFrequency: Joi.number().optional().allow(null),
cronConcurrency: Joi.number().optional().allow(null),
}),
}),
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const systemService = Container.get(SystemService);
const result = await systemService.updateLogRemoveFrequency(
req.body.frequency,
const result = await systemService.updateSystemConfig(
req.body,
);
res.send(result);
} catch (e) {