Skip to content

Node.js based forum software built for the modern web

break up sync operation

Baris Usakli12546cb9adbc
diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js
index feeed1e20a..60a24ee151 100644
--- a/src/database/mongo/sorted.js
+++ b/src/database/mongo/sorted.js
@@ -492,7 +492,7 @@ module.exports = function (db, module) {
}
if (ids.length < options.batch && (!done || ids.length === 0)) {
- return next(null);
+ return process.nextTick(next, null);
}
process(ids, function (err) {
_next(err);