diff --git a/src/controllers/template.controller.ts b/src/controllers/template.controller.ts index 317f8cf..c4d5163 100644 --- a/src/controllers/template.controller.ts +++ b/src/controllers/template.controller.ts @@ -230,12 +230,13 @@ export class TemplateController { // 检查是否有任务在5分钟内开始 const recentTasks = processingTasks.filter( - (task) => task.startedAt && task.startedAt.getTime() > fiveMinutesAgo.getTime(), + (task) => + task.startedAt && task.startedAt.getTime() > fiveMinutesAgo.getTime(), ); - if (recentTasks.length > 0) { + if (recentTasks.length > 3) { throw new HttpException( - `有${processingTasks.length}个任务正在进行中,请稍后再试`, + `有${recentTasks.length}个任务正在进行中,请稍后再试`, HttpStatus.TOO_MANY_REQUESTS, ); }