mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修改并发逻辑,系统设置增加定时任务并发设置
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user