mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改任务队列重新设置并发
This commit is contained in:
parent
aac109621a
commit
c35cfba8b0
|
@ -18,6 +18,7 @@ class TaskLimit {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.setCustomLimit();
|
this.setCustomLimit();
|
||||||
|
this.handleEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleEvents() {
|
private handleEvents() {
|
||||||
|
@ -55,8 +56,7 @@ class TaskLimit {
|
||||||
|
|
||||||
public async setCustomLimit(limit?: number) {
|
public async setCustomLimit(limit?: number) {
|
||||||
if (limit) {
|
if (limit) {
|
||||||
this.cronLimit = new PQueue({ concurrency: limit });;
|
this.cronLimit.concurrency = limit;
|
||||||
this.handleEvents();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await AuthModel.sync();
|
await AuthModel.sync();
|
||||||
|
@ -64,8 +64,7 @@ class TaskLimit {
|
||||||
where: { type: AuthDataType.systemConfig },
|
where: { type: AuthDataType.systemConfig },
|
||||||
});
|
});
|
||||||
if (doc?.info?.cronConcurrency) {
|
if (doc?.info?.cronConcurrency) {
|
||||||
this.cronLimit = new PQueue({ concurrency: doc?.info?.cronConcurrency });
|
this.cronLimit.concurrency = doc.info.cronConcurrency;
|
||||||
this.handleEvents();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user