Commit 5063725a authored by nano's avatar nano

fix async

parent e7b47198
......@@ -189,10 +189,9 @@ const uploadPackageUrl = async (ctx: Context) => {
let bundled;
await queue.run(async (ctx, next) => {
bundled = await bundle(path.basename(file.path));
this.next();
next();
});
// 打包完, 上传阿里云
await UploadOSS(bundled.distPath);
......
......@@ -64,7 +64,7 @@ export class Queue {
async run(task: Function) {
this.queue.push(task);
await this.next();
return await this.next();
}
async next() {
......@@ -73,11 +73,11 @@ export class Queue {
if (!task) {
return;
}
await task(this, () => {
this.running++;
return await task(this, () => {
this.running--;
this.next();
});
this.running++;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment