mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
boot 任务改为在依赖安装完成后执行
This commit is contained in:
@@ -189,6 +189,19 @@ class TaskLimit {
|
||||
return this.scriptLimit.add(fn, options);
|
||||
}
|
||||
|
||||
public async waitDependencyQueueDone(): Promise<void> {
|
||||
if (this.dependenyLimit.size === 0 && this.dependenyLimit.pending === 0) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
const onIdle = () => {
|
||||
this.dependenyLimit.removeListener('idle', onIdle);
|
||||
resolve();
|
||||
};
|
||||
this.dependenyLimit.on('idle', onIdle);
|
||||
});
|
||||
}
|
||||
|
||||
public runDependeny<T>(
|
||||
dependency: Dependence,
|
||||
fn: IDependencyFn<T>,
|
||||
|
||||
Reference in New Issue
Block a user