Commit 5063725a authored by nano's avatar nano

fix async

parent e7b47198
...@@ -189,10 +189,9 @@ const uploadPackageUrl = async (ctx: Context) => { ...@@ -189,10 +189,9 @@ const uploadPackageUrl = async (ctx: Context) => {
let bundled; let bundled;
await queue.run(async (ctx, next) => { await queue.run(async (ctx, next) => {
bundled = await bundle(path.basename(file.path)); bundled = await bundle(path.basename(file.path));
this.next(); next();
}); });
// 打包完, 上传阿里云 // 打包完, 上传阿里云
await UploadOSS(bundled.distPath); await UploadOSS(bundled.distPath);
......
...@@ -64,7 +64,7 @@ export class Queue { ...@@ -64,7 +64,7 @@ export class Queue {
async run(task: Function) { async run(task: Function) {
this.queue.push(task); this.queue.push(task);
await this.next(); return await this.next();
} }
async next() { async next() {
...@@ -73,11 +73,11 @@ export class Queue { ...@@ -73,11 +73,11 @@ export class Queue {
if (!task) { if (!task) {
return; return;
} }
await task(this, () => { this.running++;
return await task(this, () => {
this.running--; this.running--;
this.next(); 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