Skip to content

Commit

Permalink
fixed foreach all done order before work call
Browse files Browse the repository at this point in the history
  • Loading branch information
rook2pawn committed Jul 17, 2014
1 parent 69aec60 commit 2aadf0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ function qlib() {
padding = 0
list.forEach(function(arg,idx) {
this.queue.push({fn:iterator,type:'async',idx:idx,id:id,arg:arg,padding:padding})
if ((this.queue.length > 0) && (this.working == false)) {
this.workAsync();
}
if (idx == list.length - 1)
if (idx == list.length - 1)
this.queue.push({fn:done, idx:idx,id:id,type:'sync'})
if ((this.queue.length > 0) && (this.working == false))
this.workAsync();
},this)
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "David Wee <rook2pawn@gmail.com> (http://rook2pawn.com)",
"name": "queuelib",
"description": "Straightforward asynchronous queue processor",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/rook2pawn/node-queuelib",
"repository": {
"type": "git",
Expand Down

0 comments on commit 2aadf0d

Please sign in to comment.