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

This commit is contained in:
whyour committed 2023-07-01 15:26:20 +08:00
1 parent db227e56bf
commit 702c3160ec
18 files changed
+163 -88

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ import {
Task,
} from 'toad-scheduler';
import dayjs from 'dayjs';
import { runWithCpuLimit } from '../shared/pLimit';
import taskLimit from '../shared/pLimit';
import { spawn } from 'cross-spawn';
interface ScheduleTaskType {
@@ -49,7 +49,7 @@ export default class ScheduleService {
callbacks: TaskCallbacks = {},
completionTime: 'start' | 'end' = 'end',
) {
return runWithCpuLimit(() => {
return taskLimit.runWithCpuLimit(() => {
return new Promise(async (resolve, reject) => {
try {
const startTime = dayjs();