Skip to content

Commit

Permalink
fix(cursor): respect sort order when using eachAsync() with `parall…
Browse files Browse the repository at this point in the history
…el` and a sync callback

Fix #8557
  • Loading branch information
vkarpov15 committed Feb 14, 2020
1 parent 636be98 commit 8bd4ea2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers/cursor/eachAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = function eachAsync(next, fn, options, callback) {

// Kick off the subsequent `next()` before handling the result, but
// make sure we know that we still have a result to handle re: #8422
done();
process.nextTick(() => done());

handleNextResult(doc, function(err) {
--handleResultsInProgress;
Expand Down Expand Up @@ -117,4 +117,4 @@ function asyncQueue() {
fn(_step);
}
}
}
}

0 comments on commit 8bd4ea2

Please sign in to comment.