Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
5063725a
Commit
5063725a
authored
Jun 02, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix async
parent
e7b47198
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
src/routes/upload.ts
src/routes/upload.ts
+1
-2
src/utils.ts
src/utils.ts
+3
-3
No files found.
src/routes/upload.ts
View file @
5063725a
...
...
@@ -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
);
...
...
src/utils.ts
View file @
5063725a
...
...
@@ -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
++
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment