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() {
|
||||
this.setCustomLimit();
|
||||
this.handleEvents();
|
||||
}
|
||||
|
||||
private handleEvents() {
|
||||
|
@ -55,8 +56,7 @@ class TaskLimit {
|
|||
|
||||
public async setCustomLimit(limit?: number) {
|
||||
if (limit) {
|
||||
this.cronLimit = new PQueue({ concurrency: limit });;
|
||||
this.handleEvents();
|
||||
this.cronLimit.concurrency = limit;
|
||||
return;
|
||||
}
|
||||
await AuthModel.sync();
|
||||
|
@ -64,8 +64,7 @@ class TaskLimit {
|
|||
where: { type: AuthDataType.systemConfig },
|
||||
});
|
||||
if (doc?.info?.cronConcurrency) {
|
||||
this.cronLimit = new PQueue({ concurrency: doc?.info?.cronConcurrency });
|
||||
this.handleEvents();
|
||||
this.cronLimit.concurrency = doc.info.cronConcurrency;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user